HTML Basics
HTML (HyperText Markup Language) is the standard language for creating web pages.
1. Basic Structure of an HTML Page:
------------------------------------
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Welcome to HTML</h1>
<p>This is a basic HTML page.</p>
</body>
</html>
2. HTML Elements:
-----------------
- <html>: Root element of an HTML page.
- <head>: Contains metadata, title, and links to styles/scripts.
- <body>: Contains the visible page content.
- <h1> to <h6>: Heading tags.
- <p>: Paragraph tag.
- <a>: Hyperlink tag.
- <img>: Image tag.
- <ul>, <ol>, <li>: Lists (unordered, ordered, list item).
- <table>: Defines a table.
- <form>: Creates a form.
3. Common Attributes:
----------------------
- id: Unique identifier for an element.
- class: Specifies one or more class names for an element.
- src: Specifies the source of an image.
- href: Defines the link destination.
- alt: Alternative text for images.
- style: Adds inline CSS.
4. Forms and Input Elements:
----------------------------
- <form>: Wraps form elements.
- <input>: Defines input fields (text, password, checkbox, radio, etc.).
- <textarea>: Multiline text input.
- <select>: Dropdown selection.
- <button>: Clickable button.
5. HTML5 New Elements:
----------------------
- <header>: Defines introductory content.
- <footer>: Defines footer content.
- <section>: Defines a section in a document.
- <article>: Defines an independent article.
- <aside>: Defines content aside from the main content.
- <nav>: Defines navigation links.
- <video>: Embeds a video.
- <audio>: Embeds an audio file.
- <canvas>: Used for graphics via scripting.
This is a brief overview of HTML. Learning these basics will help you create web pages efficiently.