HTML, short for HyperText Markup Language, is the backbone of every website you see on the internet. It's the standard language used to create and structure web pages. Whether you're new to web development or brushing up your skills, this guide will walk you through everything you need to know about HTML — from the basics to advanced concepts.
- What is HTML? HTML is not a programming language — it’s a markup language. Its main job is to structure content on the web. It uses “tags” to annotate text, images, links, and other elements so that web browsers know how to display them.
Example of an HTML tag:
<p>This is a paragraph.</p>
- Basic Structure of an HTML Document Every HTML file starts with a basic structure:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a simple web page.</p>
</body>
</html>
<!DOCTYPE html>: Declares the document type (HTML5).
: The root of the HTML document.
: Contains meta-information, links to CSS, title, etc. : Contains the visible content of the web page.- Common HTML Tags and Their Uses Headings Used to define titles or subtitles:
Html
<h1>Main Heading</h1>
<h2>Subheading</h2> <!-- up to h6 -->
Paragraph
<p>This is a paragraph of text.</p>
Ordered list
<ol>
<li>First</li>
<li>Second</li>
</ol>
Tablel
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>30</td>
</tr>
</table>
Form
<form action="/submit" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
- Attributes in HTML Attributes provide additional information about elements. They're always included in the opening tag.
<a href="https://example.com" target="_blank">Open in new tab</a>
- Semantic HTML Semantic tags describe the purpose of the content.
Examples:
: Top section
: Navigation links
: Main content
: A section of content
: Independent content
: Bottom section
These improve SEO and accessibility.
- HTML5 New Features HTML5 introduced many new elements and APIs:
New semantic tags: , , , etc.
Multimedia: ,
Form enhancements: new input types and attributes
Local storage and geolocation APIs
Example of embedding a video:
<video controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
- Conclusion HTML is the foundation of the web. Whether you want to build websites, create emails, or develop web apps, understanding HTML is essential. Once you master HTML, the next steps are to learn CSS for styling and JavaScript for interactivity.
Start building simple pages, experiment with elements, and explore how HTML
Top comments (1)
I love your articles