Basic use
example.css
.card {
container-type: inline-size;
}
@container (min-width: 24rem) {
.card { display: grid; }
}
Containment limits how an element’s internals affect the rest of the page. Container queries style components from their container’s size.
.card {
container-type: inline-size;
}
@container (min-width: 24rem) {
.card { display: grid; }
}.card {
container-type: inline-size;
}
@container (min-width: 24rem) {
.card { display: grid; }
}.card {
container-type: inline-size;
}
@container (min-width: 24rem) {
.card { display: grid; }
}Keep learning CSS.
CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
2 people found this page helpful