Chapter 2 2 min read
Save

HTML Fundamentals

Web Technology I · BCA · Updated Apr 15, 2026

Table of Contents

What is HTML?

HTML (HyperText Markup Language) is the standard markup language for creating web pages. It describes the structure and content of a document using elements surrounded by angle-bracketed tags. HTML5 is the current version.

Document Structure

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>My Page</title>
</head>
<body>
    <h1>Hello World</h1>
</body>
</html>
  • <!DOCTYPE html> declares HTML5.
  • <head> holds metadata, stylesheets, scripts.
  • <body> holds visible content.

Elements and Attributes

An element usually has an opening tag, content, and closing tag: <p>text</p>. Void elements (<img>, <br>) have no closing tag. Attributes live inside the opening tag: <a href="x" target="_blank">.

Headings and Text

  • Headings <h1> to <h6> (use one h1 per page).
  • Paragraph <p>.
  • Line break <br>, horizontal rule <hr>.
  • Emphasis: <strong>, <em>, <mark>, <small>, <sub>, <sup>.

Links

<a href="https://example.com">Visit</a>
<a href="mailto:[email protected]">Email</a>
<a href="#section2">Jump</a>

Use target="_blank" rel="noopener" to open in a new tab securely.

Images

<img src="cat.jpg" alt="A ginger cat" width="300">

The alt attribute is required for accessibility and fallback.

Lists

  • Ordered: <ol><li></li></ol>.
  • Unordered: <ul><li></li></ul>.
  • Description: <dl><dt>term</dt><dd>definition</dd></dl>.

Tables

<table>
  <thead><tr><th>Name</th><th>Age</th></tr></thead>
  <tbody><tr><td>Alice</td><td>20</td></tr></tbody>
</table>

Use tables only for tabular data, not layout.

Semantic HTML5

HTML5 added tags that convey meaning: <header>, <nav>, <main>, <section>, <article>, <aside>, <footer>, <figure>, <time>. Semantic tags improve accessibility and SEO.

Multimedia

<video src="movie.mp4" controls></video>
<audio src="song.mp3" controls></audio>

Forms

<form action="/save" method="POST">
  <label>Name: <input name="n" required></label>
  <label>Age: <input type="number" name="a"></label>
  <button type="submit">Save</button>
</form>

Common input types: text, email, password, number, date, checkbox, radio, file, hidden, submit.

Global Attributes

Every element can use id, class, style, title, data-*, lang, tabindex, hidden.

Character Entities

Encode special characters: &lt; <, &gt; >, &amp; &, &quot; ", &nbsp; non-breaking space.

Summary

HTML is the skeleton of a web page. Write semantic, well-structured markup and the rest (styles, scripts, SEO, accessibility) becomes much easier.

Important Questions

  1. Explain the basic structure of an HTML5 document.
  2. Differentiate element and attribute.
  3. Write HTML for a page with heading, paragraph, image, and a link.
  4. List and explain five HTML5 semantic tags.
  5. Create an ordered list of five items.
  6. Create a table with header, three rows, and two columns.
  7. Write an HTML form with name, email, and submit button.
  8. Give five common input types.

Related Notes

Discussion

0 comments

Join the discussion

Log in to share your thoughts and help fellow students.

Log in to comment

No comments yet. Be the first to share your thoughts!