Basic HTML Tutorials
Welcome! This tutorial will introduce you to the basics of HTML (HyperText Markup Language), the standard markup language for creating web pages.
Table of Contents
- What is HTML?
- HTML Document Structure
- Common HTML Tags
- Creating Links and Images
- Lists in HTML
- Adding Comments
- Conclusion
What is HTML?
HTML stands for HyperText Markup Language. It is used to create the structure of web pages using elements called "tags."
HTML Document Structure
Every HTML document has a basic structure:
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>
Explanation:
<!DOCTYPE html>: Tells the browser this is an HTML5 document.<html>: Root element.<head>: Contains meta information (not shown on the page).<title>: Sets the page title in the browser tab.<body>: Contains visible content.
Common HTML Tags
Here are some essential HTML tags:
TagDescriptionExample<h1>–<h6>Headings (largest to smallest)<h1>Hello</h1><p>Paragraph<p>This is a paragraph.</p><strong>Bold text<strong>Important</strong><em>Italic text<em>Emphasized</em><br>Line breakFirst line<br>Second line<hr>Horizontal rule (line)<hr>
Creating Links and Images
Links
To link to another page, use the <a> tag:
<a href="https://www.example.com">Visit Example.com</a>
Images
To display an image, use the <img> tag:
<img src="https://www.example.com/image.jpg" alt="Description">
src: Image URL or file path.alt: Alternative text for screen readers.
Lists in HTML
Unordered List
<ul>
<li>Item One</li>
<li>Item Two</li>
</ul>
Ordered List
<ol>
<li>First</li>
<li>Second</li>
</ol>
Adding Comments
Comments are not displayed in the browser. They are useful for notes in your code:
<!-- This is a comment -->
Conclusion
This covers the basics of HTML! To learn more, explore resources like:
Happy coding!