Introduction to HTML
HTML (HyperText Markup Language) is the standard language used to create and design web
pages. It provides the structure of a webpage using a system of tags and attributes.
1. What is HTML?
- HTML stands for HyperText Markup Language.
- It is used to create the structure of web pages.
- HTML consists of a series of elements used to enclose or wrap different parts of content.
2. Basic Structure of an HTML Document:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
3. Important HTML Tags:
- <!DOCTYPE html>: Declares the document type.
- <html>: Root of the HTML document.
- <head>: Contains meta information, links, and title.
- <title>: Sets the title of the webpage.
- <body>: Contains the visible content.
- <h1> to <h6>: Headings, <h1> is the largest.
- <p>: Paragraph tag.
- <a>: Anchor tag for hyperlinks.
- <img>: Image tag.
- <ul>, <ol>, <li>: Lists (unordered, ordered, list item).
- <div>: Container tag used to group elements.
4. Attributes:
- Provide additional information about HTML elements.
- Written in the format: name="value"
Example: <img src="image.jpg" alt="Example Image">
5. Comments in HTML:
- Comments are not displayed in the browser.
Syntax: <!-- This is a comment -->
6. HTML Versions:
- HTML4, XHTML, HTML5 (current standard with enhanced features).
HTML is the foundation of all web development and is essential for creating modern, responsive
websites.