HTML text formatting
<b>Bold text</b><br><br>
<i>Italic text</i><br><br>
<code>TML "Computer Output" Tag</code><br><br>
This is <sub> subscript</sub> and <sup> superscript</sup>
HTML Formatting Tags
HTML uses tags <b> (“bold”) and <i> (“italic”) to format the output text, such as bold or italic
These HTML tags are called formatting tags (see the full tag reference at the bottom).
Usually the tag <strong> is used instead of the bold tag <b>, and <em> is used instead of the <i> tag.
However, the meanings of these tags are different:
<b> and <i> define bold or italic text.
<strong> or <em> means that the text you want to render is important and should be highlighted. All major browsers today are able to render fonts with various effects. However, future browsers may support better rendering.
Online Examples
Text Formatting
This example demonstrates how to format text in an HTML file.
Preformatted Text
This example demonstrates how to use the pre tag to control blank lines and spaces.
“Computer Output” Tags
This example demonstrates how different “Computer Output” tags appear.
Address
This example demonstrates how to write an address in an HTML file.
Abbreviations and Acronyms
This example shows how to implement abbreviations or acronyms.
Blockquote
This example shows how to change the direction of text.
Blockquote
This example demonstrates how to implement blockquotes of varying lengths.
This example demonstrates how to mark deleted text and inserted
This example shows how to mark deleted and inserted text.
HTML text formatting tags
Tag | Description |
---|---|
<b> | Define the Bold text |
<em> | The definition focuses on the text |
<i> | Define italics |
<small> | Define a small font size |
<strong> | Define the accent |
<sub> | Define subscripts |
<sup> | Define superscripts |
<ins> | Defines the insertion word |
<del> | Define the deleted word |
HTML “Computer Output” Tag
Tag | Description |
---|---|
<code> | Define the computer code |
<kbd> | Define the keyboard code |
<samp> | Define a sample of computer code |
<var> | Defining variables |
<pre> | Define the preformatted text |
HTML citations, references, and tag definitions
Tag | Description |
---|---|
<abbr> | Definition abbreviations |
<address> | Define the address |
<bdo> | Defines the direction of the text |
<blockquote> | Defines a long reference |
<q> | Define short quotations |
<cite> | Define a citation |
<dfn> | Define a definition project. |
IT Resource Hub » HTML text formatting