2. What is HTML?
- HTML stands for HyperText Markup Language
- It is the standard markup language for creating web pages
- HTML describes the structure of a web page using various tags
3. Basic Structure of an HTML Document
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1> Hello, World! </h1>
<p>This is a paragraph.</p>
</body>
</html>
4. Explanation
• <!DOCTYPE html> :Declares the document type and version of
HTML
• <html>: Defines the root element of the HTML document
• <head>: Contains meta-information about the document
• <title>: Sets the title of the document (appears in the browser's title bar
or tab)
• <body>: Contains the visible content of the document
• <h1>: Represents the main heading
• <p>: Represents a paragraph
5. Common HTML Tags
• <h1> - <h6>: Headings
• <p>: Paragraph
• <a>: Anchor (Hyperlink)
• <img>: Image
• <ul>,<ol>, <li>: Unordered List, Ordered List, List Item
• <tab>, <tr>, <td>: Table, Table Row, Table Data
6. Example: Creating a Link
<a href="https://www.example.com">Visit Example</a>
Explanation:
• <a>: Anchor tag used to create a hyperlink
• href="https://www.example.com": Specifies the URL the link goes to
• Visit Example: The text displayed for the link
7. Example: Inserting an Image
<img src="image.jpg" alt="Description of Image">
Explanation:
• <img>: Image tag used to embed an image
• src="image.jpg": Specifies the URL or path
to the image file
• alt="Description of Image": Provides alternative
text for the image (for accessibility)
8. Example: Creating a List
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
12. Conclusion
• HTML is a fundamental language for creating web pages.
• Understanding HTML tags allows for the creation of structured and
visually appealing content.
• Practice and experimentation with HTML tags are key to mastering
web development.