The CSS attr() Function
Reading HTML attributes in CSS with `attr()`, from classic text in `content` to typed values for any property.
Content tagged attr
Tutorial:CSS-Only Tooltips with
attr()andcontentStyled, keyboard-friendly tooltips from one HTML attribute — no JavaScript.Build CSS-only tooltips that read their text from an HTML attribute with content: attr() — positioned with a ::after pseudo-element, given an arrow, revealed on hover and keyboard focus, flipped below the element and kept gentle under reduced motion — plus the accessibility limits and pitfalls to know before shipping one.Tutorial:HTML Attributes as Real CSS Values with Typed
attr()Read HTML attributes as CSS colours, lengths and numbers.Typed attr() reads an HTML attribute as a real CSS value — type(<color>), type(<integer>), a unit like % or px, or raw-string — for any property on any element, not just text in content. Covers fallbacks for missing or invalid values, patterns for layout, transitions and view transitions, safe fallbacks in browsers without support, and when a custom property is the better choice.Post:What's New in CSS in 2027: What to Expect
CSS features closest to working everywhere in 2027.An evidence-based look at the CSS features most likely to work in every browser in 2027: typed attr(), customisable select, random(), @function and more.