SA-21/06, C-11, Asapur, Varanasi, UP support@kamaldnp.com +91 8318013442
Lesson 4 of 30

HTML Elements

2 min read · Free · No login needed

An HTML element is everything from the start tag to the end tag, including the content in between. For example, <p>Hello</p> is one complete element: <p> is the start tag, Hello is the content, and </p> is the end tag.

Tags are not elements

People often mix up the two words. A tag is just the bracketed name, like <h1>. An element is the whole thing — start tag, content, and end tag together. So <h1>Welcome</h1> is an element; <h1> alone is only a tag.

Empty elements

Some elements have no content and no end tag. They are called empty elements. The most common ones are:

  • <br> — a line break
  • <hr> — a horizontal line
  • <img> — an image
  • <input> — a form field

Nesting

Elements can sit inside other elements. This is called nesting. The inner element must close before the outer one does. Correct: <p>This is <strong>important</strong> text.</p>. Wrong: <p>This is <strong>important</p></strong> — the tags cross over, and browsers may show the page wrongly.

Tip: Browsers are forgiving — they will still show a page with broken nesting. But forgiving does not mean correct. Clean nesting keeps your pages predictable.

Example

Example
<!DOCTYPE html>
<html>
<head>
<title>Elements</title>
</head>
<body>

<p>This is a <strong>paragraph</strong> element.</p>
<p>Line one<br>Line two</p>
<hr>
<p>Text after a horizontal line.</p>

</body>
</html>

Output

Output — how it looks in the browser
Output of HTML Elements
Try it yourself: copy the code above into a file named 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.
Get certified — just ₹10

Finish all 30 lessons, pass the test (80%), pay ₹10 and get your certificate.

Take the test
Go further with a full course

Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.

AI & ML with Azure AI, AWS AI & Generative AI
₹10,000
View
Website Design & Development Workshop 2026
₹299
View
Master Python + AI Skills in 30 Days
₹499
View
Browse all courses
HTML — Lessons
1. HTML Introduction 2. HTML Editors 3. HTML Basic 4. HTML Elements 5. HTML Attributes 6. HTML Headings 7. HTML Paragraphs 8. HTML Styles 9. HTML Formatting 10. HTML Comments 11. HTML Colors 12. HTML CSS 13. HTML Links 14. HTML Images 15. HTML Favicon 16. HTML Page Title 17. HTML Tables 18. HTML Lists 19. HTML Block and Inline Elements 20. HTML Div 21. HTML Classes 22. HTML Id 23. HTML Iframes 24. HTML JavaScript 25. HTML File Paths 26. HTML Head 27. HTML Layout 28. HTML Responsive 29. HTML Semantics 30. HTML Forms
Final Test — Certificate ₹10

🤖 KAMALDNP AI Assistant

Ask about courses, website & more

Hi! I'm KAMALDNP AI Assistant. Ask me about our courses, website features, or anything else! 😊
Please wait 5s...
🛡️ 7-Day Money-Back Guarantee
🤖 KAMALDNP Assistant ✕

Request human callback:

🔐 Login Required
✕

Download karne ke liye login karo. Login ke baad yahi page pe rahoge!

Naya ho? Register karo →