HTML Basics
1. What is HTML?
- HTML stands for HyperText Markup Language.
- It is the standard language for creating webpages.
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. Common HTML Tags:
- <html>: Root element of an HTML page
- <head>: Metadata container
- <title>: Title of the document
- <body>: Main content area
- <h1> to <h6>: Header tags
- <p>: Paragraph tag
- <a>: Anchor (link) tag
- <img>: Image tag
- <ul>, <ol>, <li>: List tags
4. Attributes:
- Tags can have attributes to provide more info.
- Example: <a href="https://example.com">Visit</a>
5. Nesting and Formatting:
- HTML elements can be nested.
- Use indentation to keep code readable.
Happy coding!