Detailed HTML5 Tutorial
Detailed HTML5 Tutorial
Detailed HTML5 Tutorial
1. Introduction to HTML
- What is HTML?
HTML (HyperText Markup Language) is used to create the structure of web pages. Every webpage
<!DOCTYPE html> --> This defines the document type. HTML5 requires this declaration.
</head>
<h1>This is a Heading</h1> --> Heading elements define the titles on the webpage.
</body>
</html>
- Key Elements:
- `<head>`: Contains metadata like the page title and external resources (CSS, JS).
- `<h1>` to `<h6>`: Heading tags, `<h1>` is the largest, `<h6>` is the smallest.
- `<p>`: Paragraph tag that holds blocks of text.
- Create an HTML page with a heading and a paragraph, using the structure above.
Headings are defined with the <h1> to <h6> tags. Paragraphs are created with the <p> tag.
- Links:
- Lists:
There are two types of lists: ordered (<ol>) and unordered (<ul>). Example:
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
3. HTML Attributes
- Use the <img> tag to create an image gallery with multiple images.
4. Forms in HTML
<label for="name">Name:</label>
<label for="email">Email:</label>
</form>
- Explanation:
- `<form>`: Wraps the entire form and specifies the submission URL and method.
- Create a contact form with text and email fields and a submit button.
- Tables are used to organize data into rows and columns. Example:
<table>
<tr>
<th>Product</th>
<th>Price</th>
</tr>
<tr>
<td>Apple</td>
<td>$1</td>
</tr>
<tr>
<td>Banana</td>
<td>$0.5</td>
</tr>
</table>
- Explanation:
6. Multimedia in HTML
- HTML allows embedding multimedia using the <video> and <audio> tags. Example:
</video>
<audio controls>
</audio>