This media is not supported in your browser
VIEW IN TELEGRAM
This pseudo-class is useful for styling elements that have no content within them.
Please open Telegram to view this post
VIEW IN TELEGRAM
🙏1
Before: @media rules reacted to screen width (e.g. under 768px → smaller font).
Problem: components behave differently in cards, sidebars, modals — viewport alone isn’t enough.
Container Queries let CSS adapt to a parent’s size, not the whole screen.
.card { container-type: inline-size; }
@container (max-width: 400px) {
.card-title { font-size: 1rem; }
}How it works
• Mark a container with container-type.
• Use @container to style elements inside it.
• Components adapt to parent width, no global media hacks.
• Cleaner CSS, fewer JS tweaks, local responsive behavior.
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1🙏1