HTML Tutorial

Text Elements

Headings, paragraphs, and list structures

Headings

HTML provides six levels of headings, from <h1> (the most important) to <h6> (the least important).
html
<h1>Main Title</h1>
<h2>Sub-section</h2>
<h3>Topic</h3>
Wait! You should only have one <h1> per page. Search engines use headings to understand the hierarchy of your content. Don't use headings just to make text bigger (use CSS for that!).
  • <p>: Defines a paragraph of text.
  • <a>: The "Anchor" tag used to create links. The href attribute tells the browser where to go.
html
<p>Visit the <a href="https://google.com">Google website</a>.</p>

Formatting Text

TagMeaningDescription
<strong>BoldImportant text (strong importance)
<em>ItalicEmphasized text (stress emphasis)
<code>CodeDisplaying computer code
<blockquote>QuoteLarge block of quoted text

Lists

  1. <ul> (Unordered List): Bullet points.
  2. <ol> (Ordered List): Numbered points.
  3. <li> (List Item): Individual items inside the list.

Summary

TermDescription
h1 - h6Header hierarchy
pParagraph
aLink (Anchor)
ul / olUnordered vs. Ordered lists
liList item
brForced line break (Use sparingly!)
hrHorizontal rule (Visual separator)
Best ForOrganizing and displaying written content
Logic"Textual hierarchy and navigation"
SafetyUse target="_blank" on links to open in a new tab
ModernCombine with Google Fonts for beautiful typography
StandardUse semantic tags instead of just <div> for text
IdentityText is the primary reason the web exists