What is HTML?
HTML is the markup language that defines the structure and meaning of web pages. It tells the browser which content is a heading, paragraph, link, image, or other element.
What you will learn
- What markup, elements, and attributes mean
- How the basic HTML document is organized
- How HTML works with CSS and JavaScript
- Why semantic HTML and accessibility matter
Basic document structure
A minimal document contains a doctype, an html element, a head for metadata, and a body for visible content.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My first page</title>
</head>
<body>
<h1>Hello, HTML</h1>
<p>This is a paragraph.</p>
</body>
</html>
What the example produces
Save the example as index.html and open it in a browser. You will see a heading and a paragraph. HTML describes the role and order of content; CSS controls appearance and JavaScript adds behavior.
HTML, CSS, and JavaScript
HTML provides structure, CSS controls presentation, and JavaScript adds behavior. Keeping these roles separate makes pages easier to understand and maintain.
Common points to remember
- Use headings in a logical order.
- Use meaningful elements instead of using
divfor everything. - Give informative images suitable
alttext. - Associate form controls with visible labels.