? Basics of HTML (HyperText Markup Language)
HTML is the standard language used to create web pages. It structures the content using tags and elements.
? Basic Structure of an HTML Document
<!DOCTYPE html><html><head> <title>My First Page</title></head><body> <h1>Hello, World!</h1> <p>This is my first HTML page.</p></body></html>
? Explanation:
<!DOCTYPE html> – Declares the document type (HTML5)
<html> – Root element of the page
<head> – Contains metadata (title, links, scripts)
<title> – Sets the page title shown in the browser tab
<body> – Main content that displays on the page
? Basic HTML Tags
? Text Tags
| Tag | Description | Example |
|---|
<h1> to <h6> | Headings (h1 is largest) | <h1>Title</h1> |
<p> | Paragraph | <p>This is a paragraph.</p> |
<br> | Line break | Line 1<br>Line 2 |
<hr> | Horizontal line | <hr> |
<strong> | Bold text | <strong>Important</strong> |
<em> | Italic text | <em>Emphasis</em> |
? Link and Image Tags
| Tag | Description | Example |
|---|
<a> | Creates a hyperlink | <a href="https://example.com">Visit</a> |
<img> | Displays an image | <img src="image.jpg" alt="Description"> |
? List Tags
| Tag | Description | Example |
|---|
<ul> | Unordered list | Bullets |
<ol> | Ordered list | Numbers |
<li> | List item | Used inside <ul> or <ol> |
<ul> <li>Apple</li> <li>Banana</li></ul>
? Table Tags
<table> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Alice</td> <td>25</td> </tr></table>
? Form Tags
<form> <label for="name">Name:</label> <input type="text" id="name"> <input type="submit" value="Submit"></form>
? Styling with HTML
You can style directly using the style attribute (though CSS is better for large projects):
<p style="color: blue; font-size: 18px;">Styled Text</p>
? Summary
| Concept | Description |
|---|
| Tags | Keywords in angle brackets like <p> |
| Elements | Tags + content (e.g., <p>Hello</p>) |
| Attributes | Extra info in tags (e.g., href, src) |
| Nesting | Placing tags inside other tags properly |
| Comments | <!-- This is a comment --> |
Would you like a practice exercise or a template HTML page to start with?
Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.