HTML Text Formatting
This text is bold
This text is big
This text is italic
This is subscript and superscript
This text is big
This text is italic
This is computer output This is subscript and superscript
<html>
<body>
<p><b>This text is bold</b></p>
<p><strong>This text is strong</strong></p>
<p><big>This text is big</big></p>
<p><i>This text is italic</i></p>
<p><em>This text is emphasized</em></p>
<p><code>This is computer output</code></p>
<p>This is<sub> subscript</sub> and <sup>superscript</sup></p>
</body>
</html>
<body>
<p><b>This text is bold</b></p>
<p><strong>This text is strong</strong></p>
<p><big>This text is big</big></p>
<p><i>This text is italic</i></p>
<p><em>This text is emphasized</em></p>
<p><code>This is computer output</code></p>
<p>This is<sub> subscript</sub> and <sup>superscript</sup></p>
</body>
</html>
This text is bold
This text is strong
This text is big
This text is italic
This text is emphasized
This is computer outputThis is subscript and superscript
HTML Formatting Tags
HTML uses tags like <b> and <i> for formatting output, like bold or italic text.
These HTML tags are called formatting tags (look at the bottom of this page for a complete reference).
| Often <strong> renders as <b>, and <em> renders as <i>. However, there is a difference in the meaning of these tags: <b> or <i> defines bold or italic text only. <strong> or <em> means that you want the text to be rendered in a way that the user understands as "important". Today, all major browsers render strong as bold and em as italics. However, if a browser one day wants to make a text highlighted with the strong feature, it might be cursive for example and not bold! |
HTML Text Formatting Tags
| Tag | Description | ||
|---|---|---|---|
| <b> | Defines bold text | ||
| <big> | Defines big text | ||
| <em> | Defines emphasized text | ||
| <i> | Defines italic text | ||
| <small> | Defines small text | ||
| <strong> | Defines strong text | ||
| <sub> | Defines subscripted text | ||
| <sup> | Defines superscripted text | ||
| <ins> | Defines inserted text | ||
| <del> | Defines deleted text |
<html>
<body>
<h1>HTML Text Formatting Tags</h1>
<p><b>my bold text</b>
<p><big>my big text</big>
</br>
<em>my emphasized text </em>
</br>
<i> my italics text </i>
</br>
<small>my small text</small>
</br>
<strong> my strong text </strong>
<sub>my subscripted text</sub>
<sup>my superscripted text </sup>
</br>
<ins>my inserted text </ins>
</br>
<del>my deleted text </del>
</body>
</html>
HTML Text Formatting Tags
my bold textmy big text
my emphasized text
my italics text
my small text
my strong text my subscripted text my superscripted text
my inserted text
HTML "Computer Output" Tags
| Tag | Description | ||
|---|---|---|---|
| <code> | Defines computer code text | ||
| <kbd> | Defines keyboard text | ||
| <samp> | Defines sample computer code | ||
| <tt> | Defines teletype text | ||
| <var> | Defines a variable | ||
| <pre> | Defines preformatted text |
<html>
<body>
<em>Emphasized text</em><br />
<strong>Strong text</strong><br />
<dfn>Definition term</dfn><br />
<code>A piece of computer code</code><br />
<samp>Sample output from a computer program</samp><br />
<kbd>Keyboard input</kbd><br />
<var>Variable</var><br />
<cite>Citation</cite><br />
<pre>Citation</pre><br />
<tt>Citation</tt><br />
</body>
</html>
Emphasized text
Strong text
Definition term
A piece of computer code
Sample output from a computer program
Keyboard input
Variable
Citation
Citation