What is HTML? Complete Beginner’s Guide (with Examples)
What is HTML? Complete Beginner’s Guide (with Examples)
Are you new to web development and want to learn how websites are built? Then, understanding HTML is the first step. In this guide, we will explain HTML in simple terms, provide examples, and show you how to start creating your own web pages.
Table of Contents
-
What is HTML?
-
Why is HTML Important?
-
Basic Structure of an HTML Document
-
HTML Tags and Elements
-
Examples of HTML Code
-
How to Create Your First Web Page
-
Tips for Learning HTML
-
Conclusion
1. What is HTML?
HTML (HyperText Markup Language) is the standard language used to create web pages. It is not a programming language—it’s a markup language that tells web browsers how to display content.
With HTML, you can:
-
Add text, headings, and paragraphs
-
Insert images, videos, and links
-
Create tables, lists, and forms
-
Build structured websites
2. Why is HTML Important?
HTML is the backbone of every website. Without HTML, the internet as we know it would not exist. Here’s why HTML is crucial:
-
Website Structure: HTML provides the foundation for web pages.
-
SEO Friendly: Proper HTML structure helps search engines understand your content.
-
Browser Compatibility: HTML is supported by all modern browsers.
-
Ease of Learning: It’s beginner-friendly and easy to start with.
3. Basic Structure of an HTML Document
Every HTML page has a standard structure. Here’s the basic template:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text.</p>
</body>
</html>
Explanation:
-
<!DOCTYPE html>: Declares that this is an HTML5 document. -
<html>: The root element of the page. -
<head>: Contains meta-information like title, SEO tags, and links to CSS. -
<title>: The title shown in the browser tab. -
<body>: Contains the visible content of the page.
4. HTML Tags and Elements
HTML uses tags to define elements. Most tags come in pairs: an opening tag <tag> and a closing tag </tag>.
Common HTML tags include:
-
<h1>to<h6>: Headings -
<p>: Paragraph -
<a>: Link -
<img>: Image -
<ul>/<ol>/<li>: Lists -
<table>/<tr>/<td>: Tables -
<form>/<input>: Forms
Example:
<h2>My Favorite Websites</h2>
<ul>
<li><a href="https://www.google.com">Google</a></li>
<li><a href="https://www.youtube.com">YouTube</a></li>
</ul>
5. Examples of HTML Code
Adding an Image
<img src="https://www.example.com/image.jpg" alt="Example Image" width="300">
Creating a Link
<a href="https://www.example.com" target="_blank">Visit Example</a>
Using a Table
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Arvinder</td>
<td>30</td>
</tr>
</table>
6. How to Create Your First Web Page
-
Open Notepad (Windows) or TextEdit (Mac).
-
Copy and paste the basic HTML template.
-
Save the file with
.htmlextension, e.g.,index.html. -
Open the file in your web browser.
-
You just created your first web page!
7. Tips for Learning HTML
-
Start with headings, paragraphs, and links.
-
Practice adding images and lists.
-
Learn to structure pages using divs and sections.
-
Experiment with forms and tables.
-
Use online editors like CodePen to test your HTML instantly.
.png)
Comments
Post a Comment