Skip to content
VJ Classes

One place to learn science, commerce, arts, computers and life skills

HTML (HyperText Markup Language) describes the structure and meaning of content: this is a heading, this is a paragraph, this is a link, this is a list. It does not decide how things look; that is CSS’s job.

Your first page

Create a folder called mysite, and inside it a file called index.html. Type this, save, and open the file in your browser:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Asha's Tuition Centre</title>
</head>
<body>
  <h1>Asha's Tuition Centre</h1>
  <p>Maths and science for Classes 9 to 12, in Bhopal.</p>
  <a href="contact.html">Contact us</a>
</body>
</html>
  • <!DOCTYPE html> tells the browser this is modern HTML.
  • <head> holds information about the page: the character set, the mobile viewport and the <title> shown in the browser tab and in search results.
  • <body> holds what the visitor sees.

Elements and attributes

An element usually has an opening tag, content and a closing tag: <p>Hello</p>. Attributes add information inside the opening tag: in <a href="contact.html">, href says where the link goes. Some elements have no content and no closing tag, such as <img src="logo.png" alt="Centre logo">.

The elements you will use most

ElementUse
<h1> to <h6>Headings, from most to least important (one <h1> per page)
<p>Paragraph
<a href="...">Link
<img src="..." alt="...">Image, with alternative text for screen readers and search engines
<ul>, <ol>, <li>Bulleted and numbered lists
<table>, <tr>, <th>, <td>Tables for tabular data
<form>, <input>, <button>Forms

Semantic HTML

Modern HTML has elements that describe the role of each part of a page:

<header>Logo and site name</header>
<nav>Main menu links</nav>
<main>
  <section>
    <h2>Our courses</h2>
    <article>One course description</article>
  </section>
</main>
<footer>Address, phone, copyright</footer>

Using <header>, <nav>, <main>, <section>, <article> and <footer> instead of anonymous <div>s helps search engines, screen readers and other developers understand your page.

Accessibility from the start

  • Every image needs a meaningful alt text (or alt="" if it is purely decorative).
  • Headings should follow a logical order: do not jump from <h1> to <h4> for looks.
  • Link text should make sense on its own: “Download the syllabus”, not “Click here”.

Common mistake

Using headings to make text big. <h3> means “a sub-sub-heading”, not “medium-large text”. Choose elements for their meaning, and control size with CSS.

Try this

Build a three-page site for an imaginary business: index.html (home), about.html and contact.html. Each page should have a <header>, a <nav> with links to all three pages, a <main> and a <footer>.

Key points

  • HTML describes structure and meaning; CSS handles appearance.
  • <head> holds information about the page; <body> holds the visible content.
  • Use semantic elements: header, nav, main, section, article, footer.
  • Write meaningful alt text, logical headings and descriptive links.