The HTML style attribute is used to add styles to an element, such as color, font, size, and more.
Setting the style of an HTML element, can be done with the style attribute.
The HTML style attribute has the following syntax:
The property is a CSS property. The value is a CSS value.
The CSS background-color property defines the background color
for an HTML element.
The CSS color property defines the text color for
an HTML element
The CSS font-family property defines the font to be used
for an HTML element
The CSS font-size property defines the text size for
an HTML element
The CSS text-align property defines the horizontal text alignment for an HTML element
HTML contains several elements for defining text with a special meaning.
<b> - Bold text<strong> - Important text<i> - Italic text<em> - Emphasized text<mark> - Marked text<small> - Smaller text<del> - Deleted text<ins> - Inserted text<sub> - Subscript text<sup> - Superscript textThe HTML <b> element defines bold text,
without any extra importance.
The HTML <strong> element defines text
with strong importance. The content inside is typically displayed in bold.
The HTML <i> element defines a part of
text in an alternate voice or mood. The content inside is typically displayed in
italic.
The HTML <em> element defines
emphasized text. The content inside is typically displayed in italic.
The HTML <small> element defines
smaller text
The HTML <mark> element defines text
that should be marked or highlighted
The HTML <del> element defines text
that has been deleted from a document. Browsers will usually strike a line
through deleted text
The HTML <ins> element defines a text
that has been inserted into a document. Browsers will usually underline inserted
text
The HTML <sub> element defines
subscript text. Subscript text appears half a character below the normal line,
and is sometimes rendered in a smaller font. Subscript text can be used for
chemical formulas, like H2O
The HTML <sup> element defines
superscript text. Superscript text appears half a character above the normal
line, and is sometimes rendered in a smaller font. Superscript text can be used
for footnotes, like WWW[1]:
Aenean lorem odio, mollis sed consequat et, pellentesque id purus. Nunc sagittis malesuada urna, ultricies lacinia nisi varius vitae. Aliquam sit amet egestas sapien, nec mollis quam.