|5. HTML Elements
Chapter 5HTML Tutorial~1 min read

HTML Elements

Tags vs Elements vs Nested Elements

Beginners ना Tags आणि Elements मध्ये गोंधळ होतो. हे clearly समजून घेऊया — step by step.

HTML Element म्हणजे काय?

HTML Element = Opening Tag + Content + Closing Tag — हे तिन्ही मिळून एक element बनतात.

HTML Element — उदाहरण

html
<!-- हे एक complete HTML Element आहे -->
<h1>हे आपले पहिले heading आहे</h1>
<!-- <h1> = opening tag -->
<!-- "हे आपले पहिले heading आहे" = content -->
<!-- </h1> = closing tag -->

Nested HTML Element म्हणजे काय?

Nested element म्हणजे एक element दुसऱ्या element आत असणे. बाहेरचा = parent, आतला = child.

Nested Element — उदाहरण

html
<!-- <b> हा child, <h1> हा parent -->
<h1><b>हे आपले पहिले heading आहे</b></h1>

<!-- अनेक levels चे nesting -->
<p>हे <strong>महत्वाचे</strong> आणि <em>interesting</em> आहे.</p>

Empty HTML Element म्हणजे काय?

Empty elements ला content नसतो आणि closing tag पण नसतो. यांना void elements किंवा self-closing elements पण म्हणतात.

Empty Elements — उदाहरण

html
<br />   <!-- Line break — content नाही -->
<hr />   <!-- Horizontal rule — content नाही -->
<img src="photo.jpg" alt="Photo" />   <!-- Image -->

Tags vs Elements — फरक काय?

  • Tags म्हणजे फक्त markers — <p> आणि </p> हे tags आहेत
  • Element म्हणजे opening tag + content + closing tag मिळून — <p>हा paragraph आहे.</p> हे element आहे
  • Tags boundaries define करतात; elements content encompass करतात
  • Void elements (<br/>) closing tag नसलेले element आहेत

Key Points — लक्षात ठेवा

  • Element = Opening Tag + Content + Closing Tag
  • Nested = element आत दुसरे element (parent-child relationship)
  • Empty/Void elements: <br/>, <hr/>, <img/> — content नाही, closing tag नाही
  • Tag = boundary marker | Element = पूर्ण structure
0/13 chapters पूर्ण