Why does the sidebar appear above the content instead of side by side?
medium
A. Because flex-column stacks items vertically, not horizontally
B. Because flex-grow-1 is missing on the sidebar
C. Because d-flex is missing on the container
D. Because sidebar class is not a Bootstrap class
Solution
Step 1: Check flex direction
The container uses flex-column, which stacks children vertically.
Step 2: Understand layout effect
Vertical stacking places sidebar above content, not side by side.
Final Answer:
Because flex-column stacks items vertically, not horizontally -> Option A
Quick Check:
flex-column = vertical stack [OK]
Hint: Use flex-row for side by side, not flex-column [OK]
Common Mistakes:
Confusing flex-grow with layout direction
Forgetting d-flex disables flexbox
Assuming custom class affects flex direction
5. You want a sidebar that is always visible on desktop but collapses into a toggle button on small screens using Bootstrap. Which approach correctly combines sidebar layout and responsive behavior?
hard
A. Use d-inline for sidebar and d-block for content area
B. Use flex-column always and hide sidebar with CSS on small screens
C. Use d-flex flex-row for desktop layout and Bootstrap's offcanvas component for small screens
D. Use JavaScript to remove sidebar element on small screens
Solution
Step 1: Set desktop layout with flex
Using d-flex flex-row places sidebar and content side by side on larger screens.
Step 2: Add responsive toggle with offcanvas
Bootstrap's offcanvas component provides a sidebar that can toggle visibility on small screens.
Final Answer:
Use d-flex flex-row for desktop layout and Bootstrap's offcanvas component for small screens -> Option C
Quick Check:
Flex row + offcanvas = responsive sidebar [OK]
Hint: Combine flex layout with offcanvas for responsive sidebar [OK]
Common Mistakes:
Using flex-column which stacks vertically always
Hiding sidebar with CSS only loses accessibility
Removing sidebar element breaks navigation
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.