Skip to content

Instantly share code, notes, and snippets.

@owain
owain / responsive-block.css
Created July 21, 2021 20:55
Making App Blocks Responsive Using CSS Blog Post - Responsive Block Example
.grid {
display: grid;
grid-template-columns:
repeat(
auto-fit,
minmax(
clamp(50%, 350px, 100%),
1fr
)
@owain
owain / container-queries-example.css
Last active July 21, 2021 20:56
Making App Blocks Responsive Using CSS Blog Post - Container Query Example
.parent {
contain: layout inline-size;
}
@container (min-width: 400px) {
.child {
display: flex;
flex-wrap: wrap;
}
}
@owain
owain / dabblet.css
Created April 24, 2012 14:55 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@owain
owain / dabblet.css
Created April 19, 2012 01:13 — forked from anonymous/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;