HTML Fundamentals

By Shakib Ansari | Date: Tue, Aug 5, 2025

HTML Element Kya Hota Hai?

HTML element ek building block hota hai kisi bhi web page ko banane ke liye. Ye ek opening tag, content, aur closing tag se milke banta hai. Pura web page HTML elements se milkar banta hai jisme bahut sare elements use hote hai eg. <h1></h1>, <p></p>, <img/> and <code></code> etc.

Basic Syntax:

<tagname>Content</tagname>

Example:

<p>Hello World!</p>

Yahan <p> ek paragraph tag hai. Ismein Hello World! content hai. Ye complete line ek HTML element hai.

HTML Tag vs HTML Element:

Yaha ek baat notice karne wali ye hai ki HTML Tag aur HTML element do alag-alag cheeze hai.

  1. Tag: <p></p> —> Sirf ek tag without content or closed
  2. Element: <p>Hello</p> —> Full structure

Matlab tag sirf wrapping part hai, aur element poora combo hai (tag + content).

Types of HTML Elements

1. Block Level Element:

Block Level Element's hamesh new line se start hote hai wo full width lete hai. Block level elements ke kuch example tag's <div>, <p>, <h1>, <ul>, <section>

Example:

<h1>Main Heading</h1>
<p>This is a paragraph.</p>

Output:

Main Heading
This is paragraph.

Note: Ye dono elements full width lenge jiski wajah se ye next to each other.

2. Inline Elements:

Ye element's line ke beech mein hi rehte hai aur content ke according hi space lete hai. Inline elements ke kuch example tag's <span>, <a>, <img>, <strong>

Example:

<a href="#">Click Here</a>

3. Empty Elements:

Ye elements self closing hote hai kioki inke pass koi content nhi hota hai. Empty elements ke bhi kuch examples tag's <br>, <img>, <hr>, <input>

Example:

<img src="image.jpg" alt="photo" />
<br />

4. Nested Elements:

Jab ham kisi ek element ke andar koi dusra element likhte hai wo hote hain nested elements.

Example:

<div>
 <h2>Welcome</h2>
 <p>This is inside div</p>
</div>

Conclusion

HTML elements web page ke backbone hote hain. Agar aapko ye acche se samajh aa gaya, toh aap easily kisi bhi page ka structure samajh paoge. Ye concepts aapko React, Angular, ya kisi bhi modern framework mein bhi kaam aayenge.

About the Author

Hi, I'm Shakib Ansari, Founder and CEO of BeyondMan. I'm a highly adaptive developer who quickly learns new programming languages and delivers innovative solutions with passion and precision.

Web-Development

Comments