HTML Styles,Formatting.

Styles,Formatting.

HTML Styles

The HTML style attribute is used to add styles to an element, such as color, font, size, and more.

The HTML Style Attribute

Setting the style of an HTML element, can be done with the style attribute.
The HTML style attribute has the following syntax:

<tagname style="property:value;">

The property is a CSS property. The value is a CSS value.

Background Color

The CSS background-color property defines the background color for an HTML element.

Text Color

The CSS color property defines the text color for an HTML element

Fonts

The CSS font-family property defines the font to be used for an HTML element

Text Size

The CSS font-size property defines the text size for an HTML element

Text Alignment

The CSS text-align property defines the horizontal text alignment for an HTML element

HTML Text Formatting

HTML contains several elements for defining text with a special meaning.

HTML Formatting Elements
  • <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 text

The 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]:

Home

About

Tutorial

EBooks

Menu