Containers in Bootstrap with examples
In bootstrap, the container is used to set the content’s margin. It contains row elements and the row elements are containers of columns. This is known as the grid system.
There are two container classes in bootstrap:
Let’s look at each of the above two classes in detail with examples:
.container: The .container class provides a responsive fixed width container.
In the below example, the div with class “container” will have a fixed left and right margin and will not take the complete width of its parent or the viewport.
.container-fluid: The .container-fluid class provides a full-width container which spans the entire width of the viewport.
In the below example, the div with class “container-fluid” will take up the complete width of the viewport and will expand or shrink whenever the viewport is resized.
- Google Chrome
- Internet Explorer
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses
are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!