Bootstrap Interview Question: Difference between container-fluid and container
In Bootstrap, the difference between container-fluid
and container
is in the way they handle the layout of content within a webpage.
container-fluid:
The container-fluid
class in Bootstrap creates a full-width container that spans the entire width of the viewport. This means that the content within a container-fluid
will fill the entire width of the screen, regardless of the size of the device.
container:
On the other hand, the container
class creates a fixed-width container with a responsive layout. The content within a container
is centered on the page and adjusts its width based on the viewport size. This helps maintain a consistent layout across different screen sizes.
When deciding between using container-fluid
and container
in Bootstrap, consider the design requirements of your website and whether you want the content to be full-width or fixed-width.
Please login or Register to submit your answer