Item 1
Longer Item 2
Item 3
Very Long Content Item 4 that spans multiple lines.
Item 5
Item 6
Another Item 7
Short 8
/* CSS for Dynamic Column Grid */ body { margin: 0; font-family: sans-serif; } .auto-fill-grid { display: grid; /* Automatically creates as many columns as possible based on viewport width. */ /* Each column will be at least 200px wide, but no more than 1fr (equal fraction of remaining space). */ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1em; /* Space between grid items */ padding: 1.5em; background-color: #fdfdfd; border: 1px solid #e0e0e0; } .grid-item { background-color: #e3f2fd; /* Light blue */ border: 1px solid #90caf9; padding: 1.5em; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-radius: 6px; display: flex; /* Optional: for vertical centering of item content */ justify-content: center; align-items: center; }