HTML Learning Notes
1. Introduction to 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 elements represented by tags.
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
- <h1> to <h6>: Headings
- <p>: Paragraph
- <a>: Anchor (hyperlink)
- <img>: Image
- <ul>, <ol>, <li>: Lists
- <div>, <span>: Containers
- <br>: Line break
- <hr>: Horizontal rule
4. Attributes in HTML
- Tags can have attributes that provide additional information.
- Example: <a href="https://example.com">Visit</a>
- Common attributes: href, src, alt, id, class, style
5. Forms and Inputs
<form action="/submit" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
- Tags: <form>, <input>, <label>, <textarea>, <button>, <select>, <option>
6. Semantic HTML
- Semantic elements clearly describe their meaning.
- Examples: <header>, <footer>, <article>, <section>, <nav>, <aside>
7. Media Tags
- <img>: Embed image
- <video>: Embed video
- <audio>: Embed audio
8. HTML5 Features
- New elements: <section>, <article>, <nav>, <header>, <footer>, <main>
- Support for multimedia (<video>, <audio>, <canvas>)
- Improved form controls
9. Best Practices
- Use semantic elements for better accessibility.
- Validate HTML for errors.
- Use external CSS and JavaScript.
- Keep the structure clean and readable.
10. Useful Resources
- MDN Web Docs: https://developer.mozilla.org/en-US/docs/Web/HTML
- W3Schools HTML Tutorial: https://www.w3schools.com/html/
- HTML Reference: https://htmlreference.io/