HTML style Global Attribute

Description

The global attribute style attribute defines the inline CSS style for the element. It is allowed to use several properties and values ‚Äč‚Äčthat must be separated by a semicolon.

Syntax

<element style="style_definitions">

Values

  • style_definitionsList of CSS styles to be used in document.

Example

<h2 style="text-align: center; background-color: khaki; color: red; padding:20px; border: 2px solid green;"> Second level heading</h2>

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
YesYesYesYesYesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYesYesYesYesYes