Lesson 2 of 20 · 2 min
Basic Tags
Explore essential HTML tags for web development, including , , , , , , , , and more. Learn how to structure web content.
Here are some basic HTML tags along with examples:
1. <!DOCTYPE html>: This declaration defines the document type and version of HTML you’re using. It should be at the very beginning of your HTML document.
Example:
<!DOCTYPE html>
2.<html>: The root element of an HTML document. All other elements are enclosed within this tag.
Example:
<html>
<!-- Your content goes here -->
</html>
3. <head>: This section contains metadata about the webpage, such as the title and links to external resources.
Example:
<head>
<title>My Webpage</title>
</head>
4. <title>: Sets the title of the webpage, which appears in the browser’s title bar or tab.
Example:
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body></body>
</html>
Output :

5. <body>: Contains the visible content of the webpage, including text, images, links, and more.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Body Example</title>
</head>
<body>
<h1>Welcome to My Webpage</h1>
<p>This is a simple webpage.</p>
</body>
</html>
Output :

6. <h1>, <h2>, <h3>, …: Heading tags define headings of various levels, with <h1> being the highest level and <h6> the lowest.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Heading Example</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
Output :

7. <p>: Represents a paragraph of text.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Paragraph Example</title>
</head>
<body>
<p>This is a paragraph of text.</p>
</body>
</html>
Output :

8. <a>: Creates hyperlinks to other web pages or resources.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Anchor tag Example</title>
</head>
<body>
<a href="https://www.example.com">Visit Example.com</a>
</body>
</html>
Output :

9. <img>: Embeds images in the webpage.
Example:
<!DOCTYPE html>
<html>
<head>
<title>image Example</title>
</head>
<body>
<img src="stripes.jpg" alt="A beautiful image" width="300">
</body>
</html>

10. <ul> and <li>: Used to create unordered lists with list items.
Example:
<!DOCTYPE html>
<html>
<head>
<title>List Example</title>
</head>
<body>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</body>
</html>
Output :

These are some of the basic HTML tags you can use to structure and format your web content. HTML allows you to combine these tags creatively to create web pages with different types of content and styles.
More from HTML Tutorial
- Lesson 4 · 12 minFormattingExplore HTML formatting techniques for text, headings, lists, and more. Learn how to structure and style content on web pages effectively with HTML…
- Lesson 5 · 5 minPhrase TagsDiscover expert tips for HTML phrase tags usage in web development. Learn to emphasize, highlight, and structure text effectively with HTML and tags
- Lesson 6 · 2 minMeta TagsExplore HTML meta tags for better web SEO. Learn how to use charset, viewport, and description meta tags effectively for improved search engine…