HTML
What is HTML?
HTML stands for HyperText Markup Language. It is the backbone of every website on the internet. HTML is used to structure web pages and define the meaning of content such as headings, paragraphs, images, links, tables, and more.
Every website you see—whether it is a blog, e-commerce store, portfolio, or social media platform—is built using HTML as the foundation.
HTML is not a programming language; it is a markup language. This means it tells the browser how content should be displayed.
Why Learn HTML?
Learning HTML is the first step in becoming a web developer. It provides the basic structure for all websites.
Key Benefits:
- Easy to learn for beginners
- Forms the foundation of web development
- Works with CSS and JavaScript
- Required for frontend and backend development
- Helps in building real-world projects
Basic Structure of HTML
Every HTML page follows a basic structure:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to HTML Course</h1>
<p>This is a simple paragraph.</p>
</body>
</html>
HTML Elements
HTML is made up of elements. Each element has a tag
<p>This is a paragraph.</p>
Common Elements:
- Headings:
<h1>to<h6> - Paragraph:
<p> - Link:
<a> - Image:
<img> - Division:
<div> - Span:
<span>
HTML Headings
Headings are used to define titles and subtitles.
<h1>Main Heading</h1><h2>Sub Heading</h2>Note:
<h1>is the largest heading<h6>is the smallest heading
Paragraphs and Text Formatting
HTML allows you to format text easily.
Example:
<p>This is a paragraph.</p>
<b>Bold Text</b>
<i>Italic Text</i>
<u>Underlined Text</u>
Other Formatting Tags:
<strong>→ Important text<em>→ Emphasized text<br>→ Line break
Links in HTML
Links connect one page to another.
Types of Links:
- Internal links (within website)
- External links (other websites)
- Email links
Images in HTML
Images make websites attractive.
Attributes:
src→ image pathalt→ alternate textwidth→ size control
HTML Best Practices
- Use proper indentation
- Always close tags
- Use meaningful names
- Add alt text to images
- Keep code clean and readable