<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/understanding-and-using-the-new-css-style-queries-5fqfgw59o" -->

---
title: Understanding and using the new CSS style queries
description: Container queries are one of the most exciting additions to CSS. They allow you to query a component directly based on its size or style rather than the...
canonical: https://daily.dev/posts/understanding-and-using-the-new-css-style-queries-5fqfgw59o
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Understanding and using the new CSS style queries | daily.dev
og:description: Container queries are one of the most exciting additions to CSS. They allow you to query a component directly based on its size or style rather than the...
og:url: https://daily.dev/posts/understanding-and-using-the-new-css-style-queries-5fqfgw59o
og:image: https://api.daily.dev/og/posts/5FQfgw59O.png
og:image:alt: Understanding and using the new CSS style queries
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding and using the new CSS style queries

**[LogRocket](https://daily.dev/sources/logrocket)** · 6 min read · 14 upvotes · 0 comments

## Summary

Container queries are one of the most exciting additions to CSS. They allow you to query a component directly based on its size or style rather than the device’s viewport. Non-inheritable styles in CSS include height, width, border, border. If we want the border color of the card, the result will look like this. But style queries can shine when combined with size queries, which is really only useful when using higher-order variables. Using style queries with size and style queries are very useful.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.logrocket.com/new-css-style-queries/>

---

Tags: [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/understanding-and-using-the-new-css-style-queries-5fqfgw59o)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Understanding and using the new CSS style queries","url":"https://daily.dev/posts/understanding-and-using-the-new-css-style-queries-5fqfgw59o","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/understanding-and-using-the-new-css-style-queries-5fqfgw59o"},"datePublished":"2022-08-23T13:05:09.176Z","dateModified":"2022-08-23T13:05:09.176Z","description":"Container queries are one of the most exciting additions to CSS. They allow you to query a component directly based on its size or style rather than the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/282e159ce079a355bc0abbdd37c26c9a","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/282e159ce079a355bc0abbdd37c26c9a","isAccessibleForFree":true,"articleSection":"LogRocket","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"LogRocket","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/logrocket","url":"https://daily.dev/sources/logrocket"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/understanding-and-using-the-new-css-style-queries-5fqfgw59o","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":14},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"LogRocket","item":"https://daily.dev/sources/logrocket"},{"@type":"ListItem","position":3,"name":"Understanding and using the new CSS style queries"}]}
```

