Basic HTML Notes
1. What is HTML?
- HTML stands for HyperText Markup Language.
- It's used to structure content on the web.
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 Elements
- Headings: <h1> to <h6>
- Paragraph: <p>
- Link: <a href="https://example.com">Link Text</a>
- Image: <img src="image.jpg" alt="Description">
- Line Break: <br>
- Horizontal Line: <hr>
4. Lists
- Unordered List:
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
- Ordered List:
<ol>
<li>First</li>
<li>Second</li>
</ol>
5. Tables
<table border="1">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>
6. Forms (Basics)
<form action="/submit" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
7. HTML Attributes
- Provide additional information about elements.
- Example: <img src="pic.jpg" alt="Picture" width="200">
8. Semantic Elements
- Help with accessibility and SEO:
<header>, <nav>, <main>, <section>, <article>, <footer>