Headings

Definition: Headings are used to define titles and subtitles.

HTML provides 6 heading levels:

Largest Heading

Heading Level 3

Smallest Heading
Rules:
• <h1> should be used for main title
• Use headings in hierarchical order

Paragraph Tag

Definition: The <p> tag is used to display text paragraphs.

Syntax:
<p>This is a paragraph.</p>
Example:
<p>HTML is used to create webpages.</p>
<p>It structures the content.</p>

Link Tag (Anchor)

Definition: The <a> tag creates hyperlinks.

Syntax:
<a href="URL">Link Text</a>
Rule: The href attribute must contain a valid URL.
Example:
<a href="https://www.google.com">Visit Google</a>

Image Tag

Definition: The <img> tag is used to display images.

Syntax:
<img src="image.jpg" alt="description">
Example:
<img src="flower.jpg" alt="Flower Image">
Important Attributes:
src: The path to the image file.
alt: Alternate text if image fails to load.
1 / 4