A fixed layout sets the maximum width of any element fixed for all screen sizes in Bootstrap. We also call it a static layout, as it always remains the same.
In the visualization below, we assume that the pink background is the screen size, and the grey box is the main web design. The border around the grey box is the maximum width of the container
. We can see that the border around the grey box stops increasing at one point, as it reaches its maximum fixed width.
Bootstrap is an open-source tool for creating responsive and good-looking web applications. It has built-in classes that help developers build better-looking styles.
In Bootstrap, we can use the fixed layout by using the container
class in a div tag, or any other HTML tag. The container
class is a wrapper element that ensures it does not move in any situation.
After we import Bootstrap, the syntax of the container
class is as follows:
< tag >
The tag
can be any HTML tag that makes sections.
link
tag.container
class to make a fixed design layout.text-dark
Bootstrap class to change the text color to black (dark). Note: To learn more about the Bootstrap container class, we can click here.
Some of the pros and cons of using the fixed layout in Bootstrap are as follows:
Free Resources