HTML का center टैग || HTML center Tag

HTML का center टैग || HTML center Tag

🔷 1. Introduction:

The <center> tag in HTML is used to center-align content on a web page.
It places the content in the horizontal center of the browser window.
This tag is very easy to use and helpful for beginners.

⚠️ Note: The <center> tag is deprecated in HTML5. CSS should be used instead.


🔷 2. Definition:

The <center> tag is an HTML tag that centers text, images, tables, or other elements horizontally within the browser window.


🔷 3. Syntax:

<center>
  Your content here
</center>

Everything inside <center> and </center> will be displayed in the middle of the page.

🔷 4. Example (Code):

Welcome to My Page

This paragraph is centered.

<center>
  <h1>Welcome to My Page</h1>
  <p>This paragraph is centered.</p>
</center>

🔷 5. Output (What appears in browser):

  • The heading “Welcome to My Page”
  • and the paragraph “This paragraph is centered.”
    Both will appear in the center of the page horizontally.

🔷 6. Real Life Example:

Suppose a student is making a project page.
They want the title to be in the center.
So, they use <center><h1>My Project</h1></center> to make it look neat and aligned.


🔷 7. Practical Notes:

  • <center> is easy for beginners to use
  • But not supported in modern HTML5
  • The modern and correct way to center is using CSS:
<p style="text-align: center;">This is centered using CSS.</p>

🔷 8. Advantages:

  • Very simple to understand and use
  • Great for small projects or learning HTML
  • Helps beginners see the result quickly
  • Requires no CSS knowledge

🔷 9. Limitations:

  • Deprecated in HTML5
  • Does not allow vertical alignment
  • Not supported in professional or modern web design
  • Limited to horizontal centering only

IN HINDI

🔷 1. परिचय (Introduction):

HTML में <center> टैग का उपयोग किसी भी कंटेंट को वेबपेज के बीच में (center) दिखाने के लिए किया जाता है।
इस टैग से टेक्स्ट, इमेज, हेडिंग आदि ब्राउज़र की हॉरिज़ॉन्टल लाइन (horizontal center) में दिखाई देती है।

⚠️ ध्यान दें: यह टैग अब HTML5 में deprecated (बंद) हो चुका है।
अब इसकी जगह CSS का उपयोग किया जाता है।

🔷 2. परिभाषा (Definition):

<center> टैग एक HTML टैग है जिसका उपयोग किसी भी कंटेंट को पेज के बीचों-बीच दिखाने के लिए किया जाता है।

🔷 3. सिंटैक्स (Syntax):

<center>
  यहां आपका कंटेंट लिखा जाएगा
</center>

जो भी कंटेंट <center> और </center> के बीच लिखा जाता है, वह ब्राउज़र में बीच में दिखेगा।

🔷 4. उदाहरण (Example):

<center>
  <h1>मेरे वेबपेज में आपका स्वागत है</h1>
  <p>यह पैराग्राफ सेंटर में दिखाई देगा।</p>
</center>

🔷 5. आउटपुट (Output):

  • हेडिंग “मेरे वेबपेज में आपका स्वागत है”
  • और पैराग्राफ “यह पैराग्राफ सेंटर में दिखाई देगा”
    दोनों पेज के बीच में (सेंटर में) दिखाई देंगे।

🔷 6. वास्तविक जीवन उदाहरण (Real Life Example):

एक छात्र अपने HTML प्रोजेक्ट में <center><h1>MY PROJECT</h1></center> लगाता है,
जिससे उसका शीर्षक (heading) साफ़ और सुंदर तरीके से बीचों-बीच दिखाई देता है।


🔷 7. व्यावहारिक जानकारी (Practical Notes):

  • यह टैग HTML4 में चलता था, पर HTML5 में बंद कर दिया गया है
  • अब इसकी जगह CSS का उपयोग किया जाता है:
<p style="text-align: center;">यह CSS से सेंटर किया गया टेक्स्ट है।</p>

🔷 8. लाभ (Advantages):

  • बहुत सरल और उपयोग में आसान
  • शुरुआती छात्रों के लिए अच्छा टैग
  • छोटे प्रोजेक्ट्स में फास्ट रिजल्ट देता है
  • बिना CSS सीखे पेज सजाया जा सकता है

🔷 9. सीमाएँ (Limitations):

  • HTML5 में सपोर्ट नहीं करता
  • केवल horizontal centering करता है, vertical नहीं
  • आधुनिक वेबसाइट्स में उपयोग नहीं होता
  • प्रोफेशनल लेवल पर CSS ज़रूरी है

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *