🕵️ SicherheitslückenSQLi & XSS Vulnerabilities in a Popular Airlines Website!(10.10.2017 um 20:34 Uhr)
🕵️ SicherheitslückenBugcrowd’s Domain & Subdomain Takeover vulnerability!(10.10.2017 um 21:20 Uhr)
🕵️ SicherheitslückenUnrestricted File Upload to RCE | Bug Bounty POC(19.12.2017 um 13:48 Uhr)
🕵️ SicherheitslückenHow I was able to Bypass XSS Protection on HackerOne's Private Program(02.02.2018 um 13:10 Uhr)
🕵️ SicherheitslückenIOS 11.4 Siri Auth Bypass | CVE-2018-4238(22.05.2018 um 15:31 Uhr)
🪟 Windows TippsHow to Enable Windows 11 Screen Savers(07.09.2026 um 12:41 Uhr)
🪟 Windows TippsMicrosoft Phone Link Not Showing Messages on Windows 11? Fix It(09.09.2026 um 07:52 Uhr)
🕵️ SicherheitslückenSQLi & XSS Vulnerabilities in a Popular Airlines Website!(10.10.2017 um 20:34 Uhr)
🕵️ SicherheitslückenBugcrowd’s Domain & Subdomain Takeover vulnerability!(10.10.2017 um 21:20 Uhr)
🕵️ SicherheitslückenUnrestricted File Upload to RCE | Bug Bounty POC(19.12.2017 um 13:48 Uhr)
🕵️ SicherheitslückenHow I was able to Bypass XSS Protection on HackerOne's Private Program(02.02.2018 um 13:10 Uhr)
🕵️ SicherheitslückenIOS 11.4 Siri Auth Bypass | CVE-2018-4238(22.05.2018 um 15:31 Uhr)
🪟 Windows TippsHow to Enable Windows 11 Screen Savers(07.09.2026 um 12:41 Uhr)
🪟 Windows TippsMicrosoft Phone Link Not Showing Messages on Windows 11? Fix It(09.09.2026 um 07:52 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 2 Min Lesezeit
0

Why Everyone's Talking About CSS Container Queries (And How to Use Them)

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

For years, we’ve relied on media queries to make layouts responsive.



They work, but they come with a big limitation: they only consider the viewport size, not the size of the actual component.



Enter container queries, the game-changer for CSS layout design.









Why Should You Care?



Media queries assume every element adjusts based on the screen size.



That works—until you build reusable components that live in different contexts.



What if you want a card to shrink in a sidebar but expand in a main content area?



Media queries can’t help you. Container queries can.









How Container Queries Work



Instead of asking, “How big is the viewport?” container queries ask, “How big is my container?”



That means elements adjust their styles based on their parent container’s size instead of relying on global breakpoints.









The Syntax



First, define a container:




CODE
.card-container {
container-type: inline-size;
}






Then, write styles based on the container’s width:




CODE
@container (max-width: 400px) {
.card {
flex-direction: column;
}
}






Now, your card component adapts to its parent, not the entire screen.









Real-World Use Case



Let’s say you have a pricing card that appears in different layouts:



In the main content area, it’s wide.



In a sidebar, it’s narrow.



With container queries, you don’t need complex media query hacks. Just wrap it in a .pricing-container and let the styles handle the rest.









Browser Support



Good news: All major browsers (except Safari on iOS 15 and earlier) support it.



Check , so be sure to check it out!

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
Bugcrowd’s Domain & Subdomain Takeover vulnerability!
1 Quelle
SQLi & XSS Vulnerabilities in a Popular Airlines Website!
1 Quelle
Unrestricted File Upload to RCE | Bug Bounty POC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Why Everyone's Talking About CSS Container Queries (And How to Use Them)

Thematisch verwandte Begriffe: Everyones, Talking, About, Container · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...