Click here to Skip to main content
15,040,212 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

<div class="container-fluid">
        <div class="sidebar">
        <div class="content">

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.
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.
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

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.
Richard Deeming 24-Mar-21 13:33pm
And as I keep telling you, the sidebar class is NOT part of Bootstrap 5, or Bootstrap 4, ...

The only reference you've found to it is for Bootstrap v1.

You will need to define your own CSS classes, or use the built-in layout classes.
Member 15047625 24-Mar-21 13:44pm
I'm just wondering why they would abandon perfectly fine class. Instead of one line, now I have to dig through the depths of the internet.
Richard Deeming 24-Mar-21 14:06pm
Because it wasn't a generic class which would apply to all sites. Not every site wants a sidebar of the same width.

Use the row and col- classes. Or use the flexbox utilities.

Creating this sort of layout is trivial in all modern browsers.
1-Line Layouts[^]

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