HTML global attribute style








The style attribute defines a CSS style directly on an element as opposed to in a style element or external stylesheet.

Syntax

<element style="styleValue">

Attribute Values

styleValue
css properties and values

Browser compatibility

style Yes Yes Yes Yes Yes




Example

<!DOCTYPE HTML>
<html>
<body>
      <a href="http://java2s.com"  
         style="background: grey; color:white;  padding:10px"> 
         Visit the site
      </a>
</body>
</html>

Click to view the demo