Global Attributes
HTML style attribute
Applies inline CSS declarations to an element. It does not accept a complete selector rule. Prefer classes for reusable styling; CSP may restrict inline styles. Applicability: global HTML attribute, subject to element-specific restrictions and browser support.
Formal Syntax & Structure
html syntaxhtml
style="color: navy;"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| style | CSS declaration list | Applies inline CSS declarations to an element. It does not accept a complete selector rule. Prefer classes for reusable styling; CSP may restrict inline styles. |
Working Example
Example Snippethtml
<p style="color: navy;">Important note</p>