HTML Basics cover the fundamental building blocks of every web page. You’ll learn how to use tags, elements, and attributes to create simple and well-structured web pages.
An HTML element is everything from the start tag to the end tag.
<p>This is a paragraph.</p>
This is a paragraph.
Elements can be nested — one element inside another.
<p>This is a <b>bold</b> word inside a paragraph.</p>
This is a bold word inside a paragraph.
Headings are defined with <h1> to <h6> tags.<h1> is the largest heading, and <h6> is the smallest.
<h1>This is Heading 1</h1>
<h2>This is Heading 2</h2>
<h3>This is Heading 3</h3>
This is Heading 1
This is Heading 2
This is Heading 3
Paragraphs are defined with the <p> tag.
<p>HTML is easy to learn and fun to use!</p>
<p>Start learning HTML with Learn2Kode tutorials.</p>
HTML is easy to learn and fun to use!
Start learning HTML with Learn2Kode tutorials.
Links are defined with the <a> tag.
Use the href attribute to specify the destination URL.
<a href="https://www.learn2kode.com">Visit Learn2Kode</a>
Images are displayed using the <img> tag.
It has attributes like src, alt, width, and height.
<img src="https://via.placeholder.com/150" alt="Sample Image" width="150">
Use <br> to break a line and <hr> to create a horizontal rule.
<p>Learn HTML<br>Step by Step</p>
<hr>
<p>Keep practicing daily!</p>
Learn HTML
Step by Step
Comments are used to explain code and are ignored by the browser.
<!-- This is a comment -->
<p>This line will be visible in the browser.</p>
This line will be visible in the browser.