HTML - Style (Element|Embedded Style) - Attribute

> (World Wide) Web - (W3|WWW) > HyperText markup Language (HTML)

1 - About

Style in HTML is:

that permit to declare a style.


3 - Type

3.1 - Element

The style element allows style information to be embedded in documents.

.green {
     color: green; 
.blue {
     color: blue; 
<p>My sweat suit is <span class="green">green</span> 
and my eyes are <span class="blue">blue</span>.</p>

3.2 - Attribute

The style content attribute is a global CSS styling attribute.

Example: the words that refer to colors are marked up using the span element and the style attribute.

<p>My sweat suit is <span style="color: green; background:transparent">green</span> 
and my eyes are <span style="color: blue;background: transparent">blue</span>.</p>

Using the style attribute to hide and show content, or to convey meaning that is otherwise not included in the document, is non-conforming. (To hide and show content, use the hidden attribute.)

4 - Documentation / Reference

web/html/style.txt · Last modified: 2019/02/09 11:41 by gerardnico