Home
001 - Basic
002 - Variables
003 - Layer
🔥 004 - Nested Rules
010 - Grid
011 - Grid Complex
012 - Grid Contents
013 - Grid Logos
014 - Grid Spanning
020 - Container
021 - Container Style Queries
030 - Focus Visible
031 - Focus Within
040 - Color Scheme
🔥 041 - Color Light-Dark
042 - Color Mix
043 - Color Mix Mixer
044 - Color Mix Palette
🔥 045 - Relative Color
🔥 046 - Relative Color Palette
050 - Mask Image
051 - Background Clip Text
060 - Accent Color
070 - Has
🔥 071 - Starting Style
🔥 072 - Transition Behavior
090 - Text Wrap
🔥 100 - Popover
🔥 110 - scroll-driven animations
999 - Playground
Loading ...
CSS
:root { --article-border-radius: 5px; --article-spacing: 1.5rem; --article-color: #313131; --article-bg: #fff; --article-shadow: 0 0 2px 1px rgb(0 0 0 / 25%); } .article-grid { display: grid; margin: 0 auto; gap: var(--article-spacing); max-width: 900px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); } .article { color: var(--article-color); border-radius: var(--article-border-radius); background: var(--article-bg); box-shadow: var(--article-shadow); overflow: hidden; } .article img { aspect-ratio: 16 / 9; object-fit: cover; max-width: 100%; height: auto; } .article h2 { line-height: 1.25; margin: 0; margin-bottom: .5em; } .article p { margin: 0; } .article-body { padding: var(--article-spacing); } .article:has(.article-image) { font-size: .75rem; } .article:not(:has(.article-image)) { --article-color: #fff; --article-bg: #9c27b0; }
HTML
<div class="article-grid"> <div class="article"> <div class="article-image"> <img src="https://picsum.photos/id/33/640/480" width="640" height="480" aspect-ratio="16/9"> </div> <div class="article-body"> <h2>Praesent faucibus sollicitudin porttitor</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sodales molestie eros, vitae hendrerit massa aliquet ut. Vivamus felis magna, accumsan vel lorem ac, porta facilisis ligula. Vivamus in tincidunt metus. Suspendisse eu molestie quam. Mauris fringilla metus vitae nibh tempus ultricies. Suspendisse lacinia diam eu mi consequat condimentum.</p> </div> </div> <div class="article"> <div class="article-body"> <h2>Integer convallis tortor ac enim</h2> <p>Mauris ante lorem, sagittis eu purus id, finibus tempor quam. Suspendisse eu viverra neque. Vivamus aliquet lorem lorem, a vestibulum justo venenatis at. Nunc turpis nisi, tempus elementum tellus sit amet, viverra finibus nisi.</p> </div> </div> <div class="article"> <div class="article-body"> <h2>In hac habitasse platea dictumst</h2> <p>Vivamus a orci molestie, dictum orci eu, gravida lacus. Praesent vulputate, turpis id efficitur aliquam, diam ante luctus sapien, quis condimentum nisi orci ac mi. Praesent varius quam orci, ut mollis libero mattis id.</p> </div> </div> <div class="article"> <div class="article-image"> <img src="https://picsum.photos/id/36/640/480" width="640" height="480" aspect-ratio="16/9"> </div> <div class="article-body"> <h2>Mauris eget convallis diam</h2> <p>Nam commodo, mauris iaculis dictum consequat, risus tortor placerat massa, sed scelerisque tortor mauris non velit. Donec eu augue molestie, tempus velit in, congue ligula. Maecenas finibus nisi massa, et semper ipsum viverra a. Mauris pellentesque mi sed mauris maximus, in ultrices dui maximus.</p> </div> </div> <div class="article"> <div class="article-image"> <img src="https://picsum.photos/id/39/640/480" width="640" height="480" aspect-ratio="16/9"> </div> <div class="article-body"> <h2>Vestibulum at porta ante</h2> <p>Nulla in rutrum enim, eget semper lectus. Etiam congue at ex non elementum. Donec eu quam urna. Quisque sed ornare felis. Nam nec nunc quis lorem varius laoreet. Etiam egestas tincidunt dolor ut auctor. Quisque non magna aliquam, consectetur lorem vel, luctus enim.</p> </div> </div> <div class="article"> <div class="article-body"> <h2>Nam iaculis sem iaculis laoreet</h2> <p>Aliquam erat volutpat. Nullam ullamcorper ligula eget lacus posuere ullamcorper. Donec non libero varius, sodales risus facilisis, finibus felis. Curabitur mollis, ex et tempus commodo, purus diam iaculis purus, in lacinia metus magna quis lacus. Quisque vel nisl lectus.</p> </div> </div> </div>
-a
+A
Off
1/2
1/1
2/1
Zoom
Document
Container