HTML Full Information
A comprehensive guide to HTML, the standard markup language for documents designed to be displayed in a web browser.

What is HTML?#
HTML (HyperText Markup Language) is the standard markup language for creating web pages and web applications. It describes the structure of web pages using markup. HTML elements are the building blocks of HTML pages and are represented by tags.
History of HTML#
HTML was created by Tim Berners-Lee in 1991. The current version is HTML5, which was released in 2014. HTML5 introduced many new features including semantic elements, audio/video support, canvas, and improved form controls.
HTML Elements#
HTML elements are the building blocks of HTML pages. An HTML element is defined by a start tag, some content, and an end tag. Some elements are self-closing and don't require an end tag.
<tagname>Content goes here...</tagname>
<!-- Self-closing tag -->
<img src="image.jpg" alt="Description" />Basic HTML Document Structure#
Every HTML document follows a basic structure. The <!DOCTYPE html> declaration defines the document type, and the <html> element is the root element.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>Common HTML Tags#
Here are the most commonly used HTML tags:
- <h1> to <h6> - Headings (h1 is the largest, h6 is the smallest)
- <p> - Paragraph for text content
- <a> - Hyperlink to navigate to other pages or sections
- <img> - Image element (self-closing)
- <div> - Division/Container for grouping elements
- <span> - Inline container for styling text
- <ul> and <ol> - Unordered and ordered lists
- <li> - List item
- <table> - Table for tabular data
- <form> - Form for user input
- <input> - Input field (text, email, password, etc.)
- <button> - Clickable button
- <header> - Header section
- <footer> - Footer section
- <nav> - Navigation links
- <section> - Section of content
- <article> - Independent content
- <aside> - Sidebar content
HTML Attributes#
HTML attributes provide additional information about HTML elements. They are always specified in the start tag and come in name/value pairs like name="value".
<!-- Link with href attribute -->
<a href="https://jiocoder.com" target="_blank">Visit our site</a>
<!-- Image with src and alt attributes -->
<img src="image.jpg" alt="Description" width="500" height="300">
<!-- Input with type and placeholder -->
<input type="text" placeholder="Enter your name" required>
<!-- Div with class and id -->
<div class="container" id="main-content">Content</div>HTML5 Semantic Elements#
HTML5 introduced semantic elements that clearly describe their meaning in a human- and machine-readable way:
- <header> - Defines a header for a document or section
- <nav> - Defines navigation links
- <main> - Specifies the main content
- <article> - Defines independent, self-contained content
- <section> - Defines a section in a document
- <aside> - Defines content aside from the main content
- <footer> - Defines a footer for a document or section
HTML Forms#
Forms are used to collect user input. Common form elements include:
<form action="/submit" method="POST">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="message">Message:</label>
<textarea id="message" name="message" rows="4"></textarea>
<button type="submit">Submit</button>
</form>Best Practices#
- Always use semantic HTML5 elements
- Include alt text for images for accessibility
- Use proper heading hierarchy (h1 → h2 → h3)
- Validate your HTML code
- Keep your code clean and indented
- Use meaningful class and id names
- Always close your tags properly
Ready to test your knowledge?
Take the quiz to reinforce what you've learned in this article.
Start Quiz