What is HTML?
After completing this topic:
You will be able to explain what HTML is and create a simple web page using tags.
A webpage is a document
Every webpage you see in a browser is actually a document. The language used to write this document is HTML (HyperText Markup Language).
It is not a "programming language." HTML is a markup language β a language that indicates the structure and meaning of content. It tells the browser things like, "This is a heading," "This is a paragraph," and "This is a link."
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello</h1>
<p>This is a webpage created with HTML.</p>
</body>
</html>Save this file as index.html and open it in your browser, and you will see a heading and a paragraph. No server is needed.
The principle of tags
The core of HTML is the tag. It is enclosed in angle brackets (< >) and specifies the meaning of the content.
<!-- Heading tag: h1 (largest) ~ h6 (smallest) -->
<h1>Large Heading</h1>
<h2>Medium Heading</h2>
<!-- Paragraph tag -->
<p>This is a paragraph.</p>
<!-- Link tag: href attribute with URL -->
<a href="https://google.com">Go to Google</a>
<!-- Image tag: No closing tag (self-closing) -->
<img src="photo.jpg" alt="Image description">
<!-- List tag -->
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>Most tags consist of an opening tag + content + closing tag, such as <p>Content</p>. Some tags, like <img>, do not have a closing tag.
Remember the structure
Every HTML document has the same basic structure:
<!DOCTYPE html> <!-- Declaration: "This is an HTML5 document" -->
<html> <!-- Root element that wraps the entire document -->
<head> <!-- Invisible information (title, settings) -->
<title>Tab Title</title>
</head>
<body> <!-- All content that is visible on the screen -->
<h1>Body Start</h1>
</body>
</html>The <head> contains metadata such as the browser tab title, character encoding, and CSS links, and the <body> contains the content that the user actually sees. This structure is the same for any website.
β Apply to bio: DevBench β HTML & CSS Basics