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.
Learning resources on MDN
Browser support (view on caniuse.com)
- Chrome ❌
- Chrome Android ❌
- Edge ❌
- Firefox ❌ See bugzil.la/435426 bugzil.la/1448251 bugzil.la/1448252 Vendor position : positive
- Firefox for Android ❌ See bugzil.la/435426 bugzil.la/1448251 bugzil.la/1448252 Vendor position : positive
- Safari ❌ See webkit.org/b/204275
- Safari on iOS ❌ See webkit.org/b/204275