Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
After some time I have managed to install newest Bootstrap for ASP.NET Core 5.0, to get access to new features. But it appears they are still not accessible

HTML
<div class="container-fluid">
        <div class="sidebar">
            ...
        </div>
        <div class="content">
            ...
        </div>
    </div>


Returns two warnings:
Unknown CSS class sidebar
and content

Website launches, but obviously it does not work. What am I missing?

What I have tried:

If I would know what to do I would not ask this question.
Posted
Updated 24-Mar-21 5:29am

1 solution

sidebar and content are not classes provided by Bootstrap:
Introduction · Bootstrap v5.0[^]

Based on the warnings, you haven't defined them in your own stylesheet either. Therefore, they have no effect.

The site will "work"; it just won't look like you want it to, because you haven't specified what you want it to look like. The sidebar will appear above the content, because there's nothing to tell it otherwise.

Either use the classes which Bootstrap provides[^], or define your own CSS classes.
 
Share this answer
 
Comments
Member 15047625 24-Mar-21 13:13pm    
Sidebar and content are part of Twitter Bootstrap, but according to all laws of logic its part of Bootstrap 5.0. Because all download links lead to basic Bootstrap website.
Richard Deeming 24-Mar-21 13:16pm    
No sidebar isn't part of Bootstrap. It's part of the custom styles for the Bootstrap docs site:
Search · sidebar · GitHub[^]

You'll either need to copy the styles from the docs site, or define your own.
Member 15047625 24-Mar-21 13:22pm    
https://getbootstrap.com/1.0.0/#

Fluid layout, a few scrolls below. I have been searching for hours how to make a sidebar, solution is so close, yet so far.
Richard Deeming 24-Mar-21 13:25pm    
Wow! That's Bootstrap v1, which was released back in the heady days of 2011.

That's practically prehistoric in internet terms. There will undoubtedly be a lot of bugs, particularly in newer browsers.

I'd strongly recommend you stick to a more up-to-date version - v4 is the current release, and v5 is in beta.
Member 15047625 24-Mar-21 13:28pm    
Yes I have 5.0 but I'm trying to figure out how to use sidebar class. Bootstrap offers dozens of horizontal navbars, but it appears they hate sidebars. I have found one tutorial, it doesn't work, second one is collapsible, I want static sidebar.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900