
Front-End Practice
Use a container query when a component needs to respond to its own space
Container queries let a component adapt to its available inline space. Use a small card example to see how they differ from viewport-based media queries.

Container queries let a component adapt to its available inline space. Use a small card example to see how they differ from viewport-based media queries.

Reserve the right image proportions before loading finishes, and avoid a layout jump caused by a placeholder that changes shape.

CSS logical properties express spacing and size in relation to writing direction, helping multilingual layouts adapt without duplicating every rule.

Use prefers-reduced-motion to reduce non-essential animation while keeping progress, state changes and errors understandable to website visitors.

Diagnose a sidebar that will not stay in view by checking its inset, scrolling ancestor and available space before adding more CSS.