Markup for Characters - HTML

The finest level of markup possible in HTML is at the character level; just as in a word processor, you can affect formatting on individual characters. This section covers the basics of inline formatting.

Basic inline tags
Inline formatting elements include the following:

  • Bold (<b>)
  • Italic (<i>)
  • Big text (<big>)
  • Small text (<small>)
  • Emphasized text (<em>)
  • Strong text (<strong>)
  • Teletype (monospaced) text (<tt>)

For example, consider the following sample paragraph.

Note that several inline tags, such as strikethrough (<strike>) and underline (<u>) tags, have been deprecated in the current specifications. Even the font tag (<font>) has been deprecated in favor of spanning styles (see the Spanning section later in this chapter). As for the strikethrough and underline tags, they have been replaced by delete (<del>) and insert (<ins>), which are used for revisions (delete for deleted text, insert for inserted text).

Inline elements can affect words or even individual characters.

Inline elements can affect words or even individual characters.
Spanning tags (<span>) are used to span inline styles across multiple characters or words. In effect, the <span> tag allows you to define your own inline styles. For example, if you need to specify text that is bold, red, and underlined, you could use code similar to the following:

The <span> tag allows you to apply the stylistic formatting inline, exactly where you want it.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

HTML Topics