attr()
Limited availability
The attr()
CSS function, in the context of any property, returns the value of an attribute of an HTML element, with the option to return it as a specific type or unit. You can set a default value for missing or invalid attributes.
Compatibility (view on caniuse.com)
- Chrome ❌ Search for bugs Search for Chromestatus entry
- Chrome Android ❌ Search for bugs Search for Chromestatus entry
- Edge ❌ Search for bugs Search for Chromestatus entry
- Firefox ❌ See bugzil.la/435426 bugzil.la/1448251 bugzil.la/1448252
- Firefox for Android ❌ See bugzil.la/435426 bugzil.la/1448251 bugzil.la/1448252
- Safari ❌ See webkit.org/b/204275
- Safari on iOS ❌ See webkit.org/b/204275