Performance: Container types (container, container-fluid)
This concept affects page layout rendering speed and visual stability by controlling container width and responsiveness.
<div class="container"> <!-- content --> </div>
<div class="container-fluid"> <!-- content --> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| container-fluid (full width) | Low | Multiple on resize | Moderate | [!] OK |
| container (fixed max width) | Low | Single or fewer | Low | [OK] Good |
.container and .container-fluid in Bootstrap?.container behavior.container centers content and limits width based on screen size..container-fluid behavior.container-fluid stretches content to fill the entire screen width..container has fixed max widths; .container-fluid is full width. -> Option Ccontainer-fluid is used for full width containers.container is fixed width; container-full and fluid-container are not valid Bootstrap classes.<div class="container"> <p>Hello</p> </div>
.container responsive behavior.container changes max width at breakpoints but remains centered.<div class="container">. What is the problem and how do you fix it?container limits width and centers content, so it won't fill full width.container-fluid to make content fill entire browser width.container is fixed width; Fix: change to container-fluid. -> Option A.container-fluid to span full width, but the main content uses .container to stay centered and limited in width. Which HTML structure correctly applies this?container-fluid on header to make it span entire width.container on main to keep content centered and limited in width.<header class="container-fluid">Header</header> <main class="container">Content</main>correctly applies these classes separately to header and main.
container-fluid and main with container. -> Option BPass the test and this pattern moves unknown