HTML style Attribute

❮ HTML Attributes


<p style="color: tomato;font-family: monaco">This is a paragraph</p>


The style attribute specifies an inline style associated with an element, which determines the rendering of the affected element.

The style attribute allows style rules to be used directly with the element, it gives up much of the benefit of style sheets that divide the presentation of a markup document from its structure.

Standard Syntax

<element style="styleDefinitions">

Browser Support


Applies to:

The style attribute can be used on the following element:

Element Attribute
<style> style

Attribute Values

Value Description
styleDefinitions Specifies the "inline" way of applying style properties. (e.g. style="color:red;text-align:center")
❮ HTML Attributes