style (attribute)
The style global HTML attribute applies inline CSS styling declarations to individual elements.
Overview
The style global HTML attribute applies inline CSS styling declarations to individual elements.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 1 | 12 | 1 | 1 | 18 | 1 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
HTML
<p style="color: #c00; font-weight: bold; margin: 1rem 0;">
Text formatted with inline styles
</p> Live demo
Use cases
Using style (attribute)
The style global HTML attribute applies inline CSS styling declarations to individual elements.
Cautions
- May not be supported in older browsers.
Accessibility
- Verify how this element is announced by screen readers.
Related links
Powered by web-features