Start your journey in web development
Start learning step by step
Check your understanding
Prepare for real interviews
Test your skills
HTML is the backbone of web pages. Let's write your first page!
<!DOCTYPE html> <html> <head> <title>My First Page</title> </head> <body> <h1>Hello World!</h1> </body> </html>
HTML tags define elements like headings, paragraphs, and links.
<h1>Heading 1</h1>
<p>This is a paragraph.</p>
<a href="https://example.com">Link</a>
HTML has ordered and unordered lists for grouping items.
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<ol>
<li>First</li>
<li>Second</li>
</ol>
Forms collect user input using text fields, buttons, checkboxes, etc.
<form>
<input type="text" placeholder="Name">
<input type="submit" value="Submit">
</form>
Tables display structured data in rows and columns.
<table border="1">
<tr><th>Name</th><th>Age</th></tr>
<tr><td>John</td><td>25</td></tr>
</table>
Images make your webpage visually appealing using the <img> tag.
<img src="image.jpg" alt="My Image">
<img src="logo.png" width="100" height="100">
HTML5 allows embedding audio and video directly into pages.
<audio controls>
<source src="song.mp3" type="audio/mpeg">
</audio>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
Create navigation with hyperlinks and anchor tags.
<a href="https://example.com">Go to Example</a>
<nav>
<a href="#section1">Section 1</a>
<a href="#section2">Section 2</a>
</nav>
Use <div> for blocks and <span> for inline grouping.
<div class="container">
<h2>Title</h2>
<p>Paragraph text here.</p>
</div>
<span class="highlight">Important</span>
Semantic tags improve readability and SEO, like <header>, <footer>, <article>.
<header>
<h1>Website Title</h1>
</header>
<article>
<h2>Article Heading</h2>
<p>Content here.</p>
</article>
<footer>
<p>Β© 2026</p>
</footer>
HTML has 6 heading levels: <h1> to <h6>. Use them for structure and SEO.
<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Sub-sub Heading</h3>
Use paragraphs and tags like <strong>, <em>, <mark> for text emphasis.
<p>This is a paragraph.</p>
<strong>Bold text</strong>
<em>Italic text</em>
<mark>Highlighted text</mark>
Block elements take full width (<div>, <p>), inline elements only take required width (<span>, <a>).
<div>Block element</div>
<span>Inline element</span>
<a href="#">Link</a>
Comments help you explain code and are ignored by browsers.
<!-- This is a comment -->
<!--
Multi-line comment
describing the following section
-->
Use HTML entities to display reserved characters like <, >, &.
<p>5 < 10 && 10 > 5</p>
<p>Copyright ® 2026</p>
Links allow navigation between pages or websites using <a> tags.
<a href="https://example.com">Visit Example</a>
<a href="#section2">Go to Section 2</a>
<a href="page2.html" target="_blank">Open in New Tab</a>
Images are displayed using <img> with src and alt attributes.
<img src="image.jpg" alt="Description" width="300">
<img src="logo.png" alt="Logo" height="100">
Add media with <audio> and <video> tags.
<audio controls>
<source src="sound.mp3" type="audio/mpeg">
</audio>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
Semantic tags describe the meaning of content for accessibility and SEO.
<header>Header Section</header>
<nav>Navigation</nav>
<main>Main Content</main>
<article>Blog Post</article>
<footer>Footer Section</footer>
Iframes embed another page or content within your webpage.
<iframe src="https://example.com" width="600" height="400"></iframe>
<iframe src="video.html" frameborder="0"></iframe>
Meta tags provide information about your page to browsers and search engines.
<meta charset="UTF-8">
<meta name="description" content="Learn HTML quickly">
<meta name="keywords" content="HTML,CSS,JavaScript">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Use headings (<h1> to <h6>) and paragraphs (<p>) for structured text.
<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<p>This is a paragraph with text.</p>
<p>Another paragraph.</p>
<div> is for block-level grouping; <span> is for inline text grouping.
<div class="container">
<h2>Title</h2>
<p>Paragraph inside div.</p>
</div>
<p>This is important text.</p>
Block elements take full width, inline elements only take needed width.
<div>I am a block element</div>
<p>Another block element</p>
<span>I am inline</span>
<a href="#">Link inline</a>
Comments are notes in code ignored by browsers.
<!-- This is a single line comment -->
<!--
This is a
multi-line comment
-->
Images are added with <img> and can have attributes like src, alt, width, height.
<img src="image.png" alt="My Image" width="200" height="150">
<img src="logo.png" alt="Logo" style="border-radius:8px">
Use <a> for links and navigation.
<a href="https://example.com">Visit Example</a>
<a href="#section2">Go to Section 2</a>
<a href="mailto:someone@example.com">Send Email</a>
Embed media with <audio> and <video>.
<audio controls>
<source src="music.mp3" type="audio/mpeg">
Your browser does not support audio.
</audio>
<video width="320" height="240" controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support video.
</video>
Use <iframe> to embed another page or content.
<iframe src="https://example.com" width="600" height="400"></iframe>
<embed src="file.pdf" width="500" height="400">
Semantic tags describe content meaning and improve accessibility & SEO.
<header>Website Header</header>
<nav>Navigation Links</nav>
<main>Main Content</main>
<section>Section Content</section>
<article>Blog Article</article>
<footer>Website Footer</footer>
1. What does HTML stand for?
2. Who is making the Web standards?
3. Choose the correct HTML element for the largest heading:
4. What is the correct HTML element for inserting a line break?
5. Which character is used to indicate an end tag?
6. How can you make a numbered list in HTML?
7. What is the correct HTML for adding a background color?
8. How do you create a hyperlink in HTML?
9. Which HTML element is used to define important text?
10. How can you open a link in a new tab/browser window?
11. Which HTML element defines the title of a document?
12. Which HTML element is used to define an unordered list?
13. Which input type is used to create a checkbox?
14. Which HTML attribute is used to define inline styles?