What’s !important #16: sibling-index() Animations, Use Cases for the infinity Keyword, Container Stuck Queries, and More

The soon-Baseline sibling-index() function for animations, CSS and the 2026 FIFA World Cup, use cases for the infinity keyword, container “stuck” queries, and more. What’s !important #16: sibling-index() Animations, Use Cases for the infinity Keyword, Container Stuck Queries, and More originally handwritten and published with love on CSS-Tricks. You should Read more…

writing-mode

The writing-mode CSS property sets whether lines of text are laid out horizontally or vertically, and the direction in which blocks and lines progress. .element { writing-mode: vertical-rl; } This is most useful in languages such as Chinese, Japanese or … writing-mode originally handwritten and published with love on CSS-Tricks. Read more…

pointer-events

The pointer-events property controls whether an element can become the target of pointer events like clicks, hover states, and other pointer-based events. In other words, it lets you decide whether the browser should treat an element as interactive when the … pointer-events originally handwritten and published with love on CSS-Tricks. Read more…

translateZ()

The CSS translateZ() function adds depth to an element, drawing it closer or farther in space. In other words, it shifts an element along the Z-axis in a 3D space. .box:hover { transform: translateZ(100px); } .box.perspective:hover { transform: perspective(500px) translateZ(100px); } Either the perspective() function or perspective property is necessary for translateZ() to work. Read more…

translateY()

The CSS translateY() function shifts an element vertically by the specified amount. Specifically, it shifts an element either up or down, depending on whether the value is positive or negative. .parent:hover .box { transform: translateY(50%); /* Shift down by half the element’s height */ } CodePen Embed Fallback Along with other transform Read more…

translate()

The CSS translate() function shifts an element from its default position on a two-dimensional plane. This way, we can reposition an element horizontally, vertically, or both. .parent:hover .box { transform: translate(50px, 50%); } Hover over the box to see it move 50% of its width towards the left: CodePen Embed Fallback Along Read more…

translateX()

The CSS translateX() function shifts an element horizontally by the specified amount. Specifically, it displaces an element to the right or the left, depending on whether the value is positive or negative. .parent:hover .box { transform: translateX(50%); } CodePen Embed Fallback Along with other transform functions, it is used inside the transform property. It Read more…