2 min read · Free · No login needed
The <div> tag is the most used element in web design. It is a generic block-level container: it has no meaning of its own, it adds no styling by itself, and it simply groups other elements together so you can style them or move them as one unit.
Because a div means nothing, use it only when no better tag exists. A page header should be a <header>, a navigation menu a <nav>, the main content a <main>, and an article an <article>. These semantic tags (you will learn them in the Semantics lesson) help search engines and screen readers understand your page. Divs fill in the gaps between them.
<!DOCTYPE html>
<html>
<head>
<title>Div</title>
<style>
.card { border: 1px solid #ccc; padding: 16px; border-radius: 8px; }
</style>
</head>
<body>
<div class="card">
<h2>HTML Course</h2>
<p>Learn HTML from scratch, free.</p>
<button>Start Learning</button>
</div>
</body>
</html>
test.html, open it in your browser, and change the text to see what happens. That is how you learn — by changing things and watching the result.Finish all 30 lessons, pass the test (80%), pay ₹10 and get your certificate.
Take the testFree tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.
Browse all coursesAsk about courses, website & more
Request human callback:
Download karne ke liye login karo. Login ke baad yahi page pe rahoge!
Naya ho? Register karo →