🔰 What is HTML?
HTML is a Markup Language used to create and structure web pages.
With HTML, you can add headings, paragraphs, images, links, tables, and more to a webpage.
It tells the browser what and how to display content.
📄 Basic HTML Structure
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is my first HTML page.</p>
</body>
</html>
Explanation:
<!DOCTYPE html>– Declares that this is an HTML5 document.<html>– The root tag that contains the entire HTML document.<head>– Contains meta information like title, CSS links, etc.<body>– Contains everything visible on the webpage.
📌 Basic HTML Tags
| Tag | Purpose |
|---|---|
<h1> to <h6> |
Headings (h1 is the largest) |
<p> |
Paragraph |
<a href=""> |
To add hyperlinks |
<img src=""> |
To display images |
<br> |
Line break |
<hr> |
Horizontal line |
<ul>, <ol>, <li> |
To create lists |
<div> |
To divide sections |
<span> |
To style inline text |
🎨 Example: Image and Link
<a href="https://www.google.com">Visit Google</a>
<img src="https://via.placeholder.com/150" alt="Placeholder Image" />
✍️ Practice
Copy the code below, save it with .html extension in Notepad, and open it in your browser:
<!DOCTYPE html>
<html>
<head>
<title>My First Website</title>
</head>
<body>
<h1>Welcome!</h1>
<p>We are learning HTML.</p>
<a href="https://www.dilkibhakti.in">Visit our website</a>
</body>
</html>