Introduction to HTML
What is HTML? π§±
HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. From headings to images to links, HTML gives the web its structure.
>>"HTML is the foundation of all web pages. Without it, there is no web." π
π‘ Why Learn HTML?
- π It structures web content like text, images, links, and more.
- βοΈ It forms the basis for learning CSS and JavaScript.
- π Every website uses HTML β itβs universal!
π Basic Structure of an HTML Document
Every HTML page starts with a standard structure. Here's how a basic document looks:
Basic HTML Document 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 of Key Tags
| Tag | Description |
|---|---|
| <!DOCTYPE html> | Declares the document as HTML5 |
| <html> | Root element of the HTML page |
| <head> | Contains metadata like title, links, and scripts |
| <body> | Contains the visible content of the webpage |
π Common HTML Tags You Should Know
- <h1> to <h6> β Headings
- <p> β Paragraph
- <a> β Anchor (Link)
- <img> β Image
- <ul>, <ol>, <li> β Lists
- <div> β Division or section
- <span> β Inline container
Note
β οΈ HTML tags are not case-sensitive, but itβs best practice to use lowercase for readability and consistency.
πΌ Example: Adding an Image and Link
Link with Image
<a href="https://www.example.com">
<img src="image.jpg" alt="Example Image" />
</a>This snippet creates a clickable image that links to another website.
π Learn More
You can dive deeper into HTML by visiting the official documentation and guides:
>>"Start with HTML, and you can build the world of the web one tag at a time." π»β¨