Headings and Emphasis
Paragraphs are used to separate pieces of text, but sometimes you want text to stand out. HTML offers different tags for creating headings and emphasis.
To mark headings in a page, use the
h tags. The
h tags are marked with a number from 1 to 6 to specify the heading level. Use an
<h1> tag for the largest heading on the page, and use lower
h tags for sub-headings:
<h1>Highest Heading</h1> <h2>Sub-heading</h2> <h3>Level 3 heading</h3> <p>Regular text</p>
Sometimes you want to emphasize certain text that's not a heading. Use the
<em></em> tags to do this. Need to really emphasize something? Use the
<h3>Acme Acid Info</h3> <p>Acme Acid is great for cleaning, etc. <em>Warning: Keep away from furniture.</em> <strong>Danger! May cause instant death.</strong> </p>
Acme Acid Info
Acme Acid is great for cleaning, etc. Warning: Keep away from furniture. Danger! May cause instant death.
Note that the
<em> elements are inside the
<p> element. Most elements can be nested inside each other in HTML, but make sure you place the closing tags correctly!