-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bootstrap menu not rendering properly in Blazor 0.5 #15759
Comments
Fixed with 8c452ff71ad1c59af0115747794a313d91ace789 We'll apply a more long-term fix when we reintroduce the markup optimization later. |
@SteveSandersonMS |
@MarkStega Could you please share a simple project that reproduces the issue? I tried my best to clean up the snippet you posted previously and tried it out in a new Blazor app. I did see the weird styling issue briefly, but it seemed to be caused by an odd interaction with the default site.css included in the template. |
@danroth27 Here is a sample:
(3) Replace navmenu.cshtml with
(4) Replace mainlayout.cshtml with
|
@MarkStega I think I can reproduce it, but isn't the issue simply this CSS statement? .nav-item:first-of-type {
padding-top: 1rem;
} |
@MarkStega Please note that application created by Visual Studio has a design with main menu on the left (on big screen) and "hamburger" menu on small screen. It works differently than standard Bootstrap library which uses jquery to create some interactivity. You have to analyse |
Thanks, I never thought of looking at site.css and indeed the navitem css all needs to be removed. I am looking at using BlazorStrap components to avoid the jquery issues. I guess I am struggling a bit with the use of Bootstrap and trying to figure out what is useable and what is not. |
The following code in my navmenu.cshtml fails to render properly. Attached are two images. navbar-properlyrendered.png & navbar-blazorrendered.png show the odd styling (notice the layout of the three links) in Blazor.
The proper rendering is in a static html page with the bootstrap css/js imports. The Blazor rendering is from a project derived from the template produced Blazor client.
NAVBAR-PROPERLY-RENDERED
NAVBAR-BLAZOR-RENDERED
The text was updated successfully, but these errors were encountered: