My admin panel has this issue: Cards should automatically reduce the number of columns as the viewport becomes narrower.. What CSS change fixes it?

CSS Published Updated 0 Views Verified
Problem: Cards should automatically reduce the number of columns as the viewport becomes narrower. Context: This CSS troubleshooting question uses a admin panel example. Correct approach: Use auto-fit with minmax() so the grid can reflow automatically. Working CSS: .cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:20px; }
Looking for the latest Sarkari Result 2026 updates? Check the latest government exam results, merit lists and result updates on Sarkari Resultess.
Sarkari Resultess
Questions & Answers

Answer & Explanation

4 Answers
Verified

A. Common but incorrect approach

Use fixed 300px columns
Additional Explanation
This approach does not directly implement the required CSS behavior.
Sarkari Resultess
Editorial Answer 1
Verified Correct Answer

B. Correct CSS solution

.cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:20px; }
Additional Explanation
Use auto-fit with minmax() so the grid can reflow automatically.
Sarkari Resultess
Editorial Answer 2
Verified

C. Incorrect CSS alternative

Use width:100vw on every card
Additional Explanation
This is not a valid CSS property or does not solve the stated problem.
Sarkari Resultess
Editorial Answer 3
Verified

D. Another incorrect approach

Use white-space:nowrap
Additional Explanation
This does not address the underlying CSS layout or styling issue.
Sarkari Resultess
Editorial Answer 4