The style Attribute

The style Attribute

<p style="color:red">I am a paragraph</p>
//the property is a CSS property; the value is a CSS value
<tagname style="property:value;">

Is used to specify the styling of an element, like color, font, size etc.

Background Color

<body style="background-color:powderblue;">

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>

Defines the background color for an HTML element.

Text Color

Fonts

<h1 style="font-family:verdana;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>

Defines the font to be used for an HTML element.

Text Size

<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>

Defines the text size for an HTML element.

Text Alignment

<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>

Defines the horizontal text alignment for an HTML element.

The style Attribute — Structure map

Clickable & Draggable!

The style Attribute — Related pages: