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

NameTypeDescription
styleCSS declaration listApplies 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>
HTML Reference