Learn HTML step by step with examples and exercises!
Every HTML document has the following basic structure:
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> Content goes here. </body> </html>
Headings define the structure of your content, and paragraphs provide detailed text:
<h1>Main Heading</h1> <p>This is a paragraph of text.</p>
h1
heading "Welcome to My Page" and a paragraph describing your favorite hobby.
Links and images make your content more interactive:
<a href="https://www.example.com">Visit Example</a> <img src="image.jpg" alt="Description of image">
Lists are used to display related items:
<ul> <li>Item 1</li> <li>Item 2</li> </ul> <ol> <li>Step 1</li> <li>Step 2</li> </ol>
Tables organize data into rows and columns:
<table border="1"> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>John</td> <td>30</td> </tr> </table>
Forms collect input from users:
<form action="/submit" method="post"> <label for="name">Name:</label> <input type="text" id="name" name="name"> <button type="submit">Submit</button> </form>
For further learning, check out these links: