+ 4

Responsive Layout with Bootstrap

You're building a webpage layout using Bootstrap. Which class should you use to make a container stretch across the full width of the viewport and adapt responsively to screen size? Options: A) .responsive B) .container-fluid C) .auto-fit D) .grid

15th Jul 2025, 7:01 AM
Derek Landon
Derek Landon - avatar
3 Réponses
+ 3
instead of answering your question, here is a link. The answer is in there. It's also a good Bootstrap learning resource. https://getbootstrap.com/docs/5.0/layout/containers/
15th Jul 2025, 7:07 AM
Bob_Li
Bob_Li - avatar
+ 4
B) .container-fluid. In Bootstrap, the .container-fluid class is used to create a container that spans the entire width of the viewport and adapts responsively to different screen sizes. Unlike .container, which has a fixed max-width at different breakpoints, .container-fluid ensures full width at all times.
15th Jul 2025, 6:25 PM
𝕨𝕔𝕪𝕓𝕖𝕣𝟟𝟚
𝕨𝕔𝕪𝕓𝕖𝕣𝟟𝟚 - avatar
+ 4
<div class="container-fluid"> <h1>Full-Width Container</h1> <p>This container stretches across the entire width of the viewport.</p> </div>
15th Jul 2025, 6:25 PM
𝕨𝕔𝕪𝕓𝕖𝕣𝟟𝟚
𝕨𝕔𝕪𝕓𝕖𝕣𝟟𝟚 - avatar