Articles Tagged
container
The CSS container
property is a shorthand that combines the container-name
and container-type
properties into a single declaration.
.parent {
container: cards-grid / inline-size;
/* Equivalent to: */
container-name: cards-grid;
container-type: inline-size;
}
Constituent properties
The container
property is a …
container-type
The CSS container-type
property is part of the Container Queries feature used to register an element as a container that can apply styles to other elements when it meets certain conditions.
.parent {
container-type: inline-size;
}
@container (width < 500px)
… container-name
The CSS container-name
property is used to register an element as a container that applies styles to other elements based on the container’s size and styles.
.parent {
container-name: cards;
container-type: inline-size;
}
@container cards (width 800px) {
.child {
… A Few Times Container Size Queries Would Have Helped Me Out
CSS Container Queries are still gaining traction and many of us are getting our hands wet with them, even if it’s for little experiments or whatnot. They’ve got great, but not quite full, browser support — enough to justify using …
Digging Deeper Into Container Style Queries
I wrote up some early thoughts on container style queries a little while back. It’s still early days. They’re already defined in the CSS Containment Module Level 3 specification (currently in Editor’s Draft status) but there are still a couple …
Early Days of Container Style Queries
We’re still in suuuuuper early days with container queries. Too early for broad browser support, but Chromium already supports it, Safari started supporting it in version 16, and Firefox is presumably not far behind.
Most early days conversations …
iShadeed’s Container Queries Lab
Ahmad Shadeed got an early jump on container queries and has a growing collection of examples based on everyday patterns.…