WEB TECHNOLOGIES โ€ข LEVEL 08

HTML Text, Links & Media

Learn how HTML communicates written content, creates navigation, displays images, embeds audio and video, and connects external content to a web page.

โฑ๏ธ Estimated Learning Time: 3โ€“4 Hours ๐ŸŸข Beginner ๐Ÿ“š 25+ Core Concepts

What You Will Learn

After completing this level, you should be able to create meaningful text content, navigation links and multimedia content using HTML.

โœ“ Create paragraphs and headings correctly.
โœ“ Use inline text-formatting elements appropriately.
โœ“ Create absolute and relative hyperlinks.
โœ“ Create internal page navigation.
โœ“ Create email and telephone links.
โœ“ Add meaningful alternative text to images.
โœ“ Use figure and figcaption for media explanations.
โœ“ Embed audio and video.
โœ“ Understand the purpose of source elements.
โœ“ Embed external content using iframe.

1. Text Content in HTML

HTML is not only about creating boxes on a screen. One of its most important jobs is to communicate the structure and meaning of written content.

A browser needs to understand whether a piece of content is a heading, paragraph, quotation, code sample or emphasized statement.

Why does this matter?

Correct HTML structure improves readability, accessibility, maintainability and the way browsers and assistive technologies understand a page.

2. Paragraphs and Line Breaks

The <p> element represents a paragraph.

<p>HTML gives structure to web content.</p>

<p>CSS controls presentation.</p>

<p>JavaScript adds behaviour.</p>

Line Break โ€” <br>

The <br> element creates a line break within text.

<p>
    CodeBhavya<br>
    From Learning to Limitless Possibilities.
</p>
Important: Do not use many <br> elements just to create page spacing. Layout spacing should normally be handled by CSS.

3. Headings and Heading Hierarchy

HTML provides six heading levels:

<h1>Main Heading</h1>
<h2>Major Section</h2>
<h3>Subsection</h3>
<h4>Detailed Subsection</h4>
<h5>Smaller Heading</h5>
<h6>Smallest Heading</h6>

Think of headings as the outline of your document.

h1 โ†’ h2 โ†’ h3 โ†’ h4
Remember: Choose headings because of their structural meaning, not simply because one heading looks visually larger.

4. Bold, Italic and Semantic Emphasis

Element Purpose Example
<strong> Strong importance Important concept
<em> Emphasis Important word
<mark> Highlighted/relevant text Highlighted
<small> Side information Additional information
<del> Deleted content Old price
<ins> Inserted content New price
<sub> Subscript H2O
<sup> Superscript x2
<p>
    HTML is <strong>important</strong> for web development.
</p>

<p>
    Learn <em>step by step</em>.
</p>

<p>
    Water = H<sub>2</sub>O
</p>

<p>
    Area = x<sup>2</sup>
</p>

5. Quotations and Citations

Short quotation โ€” <q>

<p>
    The instructor said:
    <q>Learn by building.</q>
</p>

Long quotation โ€” <blockquote>

<blockquote>
    Learning web development requires understanding
    how structure, presentation and behaviour work together.
</blockquote>

Citation โ€” <cite>

<p>
    Source:
    <cite>HTML Living Standard</cite>
</p>

6. <code> and <pre>

The <code> element represents a fragment of computer code.

<p>
Use the <code>console.log()</code> function.
</p>

The <pre> element preserves whitespace and line breaks.

<pre>
function hello() {
    console.log("Hello");
}
</pre>

8. Absolute vs Relative URLs

Absolute URL

Contains the complete address.

<a href="https://codebhavya.com/">
CodeBhavya
</a>

Relative URL

Describes a location relative to the current page.

<a href="index.html">
Web Technologies
</a>
Easy rule: Use absolute URLs when linking to another website. Use relative URLs when navigating within your own website.

9. Internal Page Links

An element can have an id, and a link can use that ID with #.

<section id="media">
    <h2>Media</h2>
</section>

<a href="#media">
    Jump to Media
</a>

This technique is useful for long documentation pages.

10. Opening Links in a New Tab

<a
    href="https://example.com"
    target="_blank"
    rel="noopener noreferrer"
>
    Open Website
</a>
When using target="_blank", using rel="noopener noreferrer" is a good defensive practice for external links.

11. Email and Telephone Links

<a href="mailto:hello@example.com">
    Email Us
</a>

<a href="tel:+911234567890">
    Call Us
</a>

These links allow devices to hand the action to an appropriate email or telephone application.

12. Images with <img>

Images are embedded using the <img> element.

<img
    src="images/codebhavya.png"
    alt="CodeBhavya learning platform"
>
Important: The img element is a void element. It does not have a closing </img> tag.

13. Alternative Text โ€” alt

The alt attribute provides a text alternative for an image.

Informative image

<img
    src="http-flow.png"
    alt="Diagram showing an HTTP request from a browser to a server"
>

Decorative image

<img
    src="decorative-line.png"
    alt=""
>
Good alt text describes the useful meaning of the image, not simply its filename.

14. Image Dimensions

<img
    src="course.jpg"
    alt="Web Technologies course"
    width="800"
    height="450"
>

Width and height can communicate the intrinsic dimensions of an image. CSS can then control its responsive display.

15. <figure> and <figcaption>

<figure>

    <img
        src="browser-flow.png"
        alt="Browser request and response flow"
    >

    <figcaption>
        Basic browser-server communication.
    </figcaption>

</figure>
Illustrative browser to server communication diagram
Example figure with a descriptive caption.

16. Audio with <audio>

HTML provides native audio support.

<audio controls>

    <source
        src="audio/lesson.mp3"
        type="audio/mpeg"
    >

    Your browser does not support audio playback.

</audio>

Example audio player (a two-tone WAV sound generated for this lesson):

17. Video with <video>

<video
    controls
    width="720"
>

    <source
        src="video/lesson.mp4"
        type="video/mp4"
    >

    Your browser does not support video playback.

</video>

Example video player (a short, silent CodeBhavya HTML media demo):

18. Why Use <source>?

A media element can contain multiple source files. This allows the browser to choose a supported source.

<video controls>

    <source
        src="lesson.webm"
        type="video/webm"
    >

    <source
        src="lesson.mp4"
        type="video/mp4"
    >

    Your browser does not support video.

</video>
The type attribute tells the browser what media format the source represents.

19. <iframe>

An iframe embeds another browsing context inside the page.

<iframe
    src="https://example.com"
    title="Example website"
    width="100%"
    height="400"
>
</iframe>
Security and privacy: Only embed content from sources you trust and understand. Many websites deliberately prevent themselves from being embedded.

20. Making Media More Useful

โœ“ Give informative images meaningful alt text.
โœ“ Use empty alt text for decorative images when appropriate.
โœ“ Give iframe content a meaningful title.
โœ“ Provide fallback text for audio/video.
โœ“ Consider captions/transcripts for important video content.
โœ“ Do not make essential information available only through images.

21. Responsive Media Basics

Images, video and embedded content should not overflow smaller screens.

img,
video,
iframe {
    max-width: 100%;
}

CSS will become much more powerful for responsive layouts when we reach the CSS section of this course.

22. Common Text, Link and Media Mistakes

Mistake 01

Using headings only because they look large.

Mistake 02

Using many <br> elements for layout.

Mistake 03

Leaving useful images without meaningful alt text.

Mistake 04

Using a clickable image without explaining its purpose.

Mistake 05

Opening external pages in new tabs without considering the security relationship.

Mistake 06

Embedding media that cannot be used on mobile screens.

23. HTML Text, Links & Media Playground

Write HTML on the left and see the browser-rendered result on the right.

Your HTML

Browser Preview

24. Practice Challenges

Try these challenges without looking at the solution first.

Challenge 01 โ€” Text Page Easy

Create an HTML page containing a title, three headings and four paragraphs.

Goal: Practice document hierarchy.

Challenge 02 โ€” Course Navigation Easy

Create links for Home, C, Python, AI & ML and Web Technologies.

Use relative links for pages inside your website.

Challenge 03 โ€” Internal Navigation Easy

Create a page with Introduction, HTML, CSS and JavaScript sections. Add a navigation menu that jumps to each section.

Challenge 04 โ€” Accessible Image Medium

Add three images:

  • An informative diagram
  • A decorative icon
  • A course thumbnail

Write appropriate alt text for each.

Challenge 05 โ€” Media Page Medium

Create a page containing an image, audio player, video player and an iframe.

Challenge 06 โ€” Code Documentation Medium

Create an HTML tutorial explaining <a>, <img>, <audio> and <video>.

Display the examples using <pre> and <code>.

Challenge 07 โ€” CodeBhavya Lesson Hard

Build a complete HTML-only CodeBhavya lesson.

Include headings, paragraphs, internal navigation, external links, images, figure captions, audio, video and a final resources section.

Challenge 08 โ€” Placement Resource Page Hard

Build a placement preparation resource page containing links to C, DSA, Python, Java and aptitude resources.

Add relevant images and a video learning resource.

25. Test Your Understanding

Question 01

Which element represents a paragraph?

Question 02

Which element creates a hyperlink?

Question 03

Which attribute specifies the destination of a link?

Question 04

Which attribute provides alternative text for an image?

Question 05

Which element is used for audio?

Question 06

Which element is used to embed video?

Question 07

Which element provides a caption for a figure?

Question 08

Which element embeds another browsing context?

26. Interview Preparation

Hover over a card to reveal the answer.

QUESTION 01

What is the difference between strong and b?

<strong> conveys strong importance, while <b> mainly draws attention without adding the same semantic meaning.

QUESTION 02

What is the purpose of alt?

It provides a text alternative that communicates the useful meaning of an image when the image cannot be perceived.

QUESTION 03

What is href?

href specifies the destination of an anchor link.

QUESTION 04

What is the difference between absolute and relative URLs?

An absolute URL identifies a complete address. A relative URL describes a location relative to the current document.

QUESTION 05

Why use figure and figcaption?

They group media with an associated caption, making the relationship between the content and its explanation explicit.

QUESTION 06

Why use source inside video?

Multiple source files can be supplied so the browser can choose a format it supports.

27. Quick Revision

Concept Remember
Paragraph <p>
Heading <h1> to <h6>
Hyperlink <a href="...">
Internal link href="#id"
Image <img>
Image alternative alt
Figure <figure>
Figure caption <figcaption>
Audio <audio>
Video <video>
Media source <source>
Embedded browsing context <iframe>

28. Glossary

Hover over each card to reveal the definition.

TERM 01

Anchor

An HTML element used to create hyperlinks.

TERM 02

Absolute URL

A complete URL containing the full destination address.

TERM 03

Relative URL

A URL interpreted relative to the current document or site location.

TERM 04

Alternative Text

Text that communicates the useful meaning of an image.

TERM 05

Figure

A self-contained piece of media or content that can have an associated caption.

TERM 06

Iframe

An element used to embed another browsing context inside the current page.

TERM 07

Media Source

A specific audio or video resource supplied using the source element.

TERM 08

Semantic Emphasis

Marking content according to its meaning, such as strong importance or emphasis.

TERM 09

Responsive Media

Media that can adapt to available screen space without causing unwanted overflow.

29. Build a Complete HTML Media Lesson

Create one complete HTML page called web-learning-resources.html.

โœ“ Add a meaningful h1.
โœ“ Add at least three h2 sections.
โœ“ Add paragraphs.
โœ“ Add internal navigation links.
โœ“ Add two external links.
โœ“ Add an informative image.
โœ“ Add figure and figcaption.
โœ“ Add an audio player.
โœ“ Add a video player.
โœ“ Add an iframe with a meaningful title.
Placement mindset: Do not merely memorize tags. Be able to explain why you selected each element.
โœ“

You Can Now Build Rich HTML Content

You now understand how HTML represents text, creates navigation and embeds different types of media.

The next major step is to expand your HTML knowledge with additional document structures and controls before moving deeper into CSS.

Complete the knowledge check and practice challenges to reinforce this level.