I am using Bootstrap 3 to build a website that displays nicely on mobile devices and desktops. The customer tells me that the max width of a page can only be 970px.
How can I do this with Bootstrap 3 to make sure that:
The page still centered in a browser screen?
All the great things in Bootstrap 3 are still there.
Choose from a responsive, fixed-width container (meaning its max-width changes at each breakpoint) or fluid-width (meaning it's 100% wide all the time). container-fluid class can be used to get full width container. container-fluid class provides a full-width container which spans the entire width of the viewport.
Images in Bootstrap are made responsive with .img-fluid . max-width: 100%; and height: auto; are applied to the image so that it scales with the parent element.
With Bootstrap 3, we've rewritten the project to be mobile friendly from the start. Instead of adding on optional mobile styles, they're baked right into the core. In fact, Bootstrap is mobile first. Mobile first styles can be found throughout the entire library instead of in separate files.
We can create a full width container in Bootstrap5 using “. container-fluid” class. It sets the container width equal to 100% in all screen sizes. This means the container spans the entire width of the viewport.
Do you want it responsive? Try this:
@media (min-width: 1200px) {
.container {
width: 970px;
}
}
This will set container width to 970px for screens wider than 1200px.
Bootstrap actually have a less feature on their website. Here you can pick and choose what components of bootstrap you want to use. All of bootstrap is made to be responsive so you can change the size to be whatever you want and everything will inherit from that.
So if you want to define .container as max-width: 970px that might serve your purposes. Or maybe just change the media query breakpoints.
Edit: Just took a look and you can define the size of your grid system for each screen size in the customize section. @container-sm, @container-md, @container-lg
Second Edit: I forgot about this resource I had bookmarked from a while back. You will probably find it useful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With