<!DOCTYPE html>

<html>

  <head>

    <title>HTML Text and Formatting</title>

  </head>

  <body>

    <h1>Main Heading (h1)</h1>

    <h2>Subheading (h2)</h2>

    <p>This is a paragraph of text. HTML allows you to format <strong>important</strong> or <b>bold</b> words.</p>

    <p>You can also use <em>emphasis</em> or <i>italic</i> styles for different purposes.</p>

    <p>Here’s how you can <u>underline</u> text using the <code><u></code> tag.</p>

    <p>Line one.<br>Line two after a line break using <code><br></code>.</p>

    <hr>

    <div>

      <p>This paragraph is inside a <strong><div></strong> container.</p>

    </div>

    <p>This is a <span style=”color: green;”>green word</span> using a <code><span></code> tag and inline CSS.</p>

  </body>

</html>

Explanation of Each Tag

SEE RESULT

Explanation of Each Tag

Tags Used in This Sample

TagWhat It Does
<h1>–<h2>Headings (large to small)
<p>Paragraph
<strong>Important (bold)
<b>Bold (non-semantic)
<em>Emphasis (italic)
<i>Italic (non-semantic)
<u>Underline
<br>Line break
<hr>Horizontal line
<div>Block container
<span>Inline container for styling