Explore interactive patterns that used to require JavaScript—now achievable with native HTML and CSS. Click a card below to learn when, where, and how to use each feature.
This CSS snippet powers the layout and card design on this page:
p.lead: Centers and limits the width of the intro text for readability..grid: Uses CSS Grid with auto-fit and minmax to make a responsive card layout..card: Styles each demo card with padding, border, and rounded corners..card:hover: Adds a subtle lift and shadow effect when hovering.p.lead {
max-width: 720px;
margin: 0 auto;
font-size: 1.1rem;
color: #555;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1rem;
margin-top: 2rem;
}
.card {
background: #fff;
border: 1px solid #d0d7de;
border-radius: 8px;
padding: 1rem;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
transform: translateY(-4px);
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));repeat() tells the browser to repeat a column pattern.auto-fit automatically fits as many columns as possible in the available space.minmax(220px, 1fr) means each column is at least 220px wide but can grow to take up available space (1fr).transition: transform 0.2s ease, box-shadow 0.2s ease;transform and box-shadow over 0.2 seconds.ease makes the animation start fast and end slow.transform: translateY(-4px);box-shadow: 0 4px 12px rgba(0,0,0,0.08);0 = no horizontal offset.4px = vertical offset (shadow appears below).12px = blur radius (softness of shadow).rgba(0,0,0,0.08) = color (black at 8% opacity).