HTML Body टैग में Leftmargin और Topmargin Attributes || Leftmargin and Topmargin Attributes in  Tag

HTML Body टैग में Leftmargin और Topmargin Attributes || Leftmargin and Topmargin Attributes in Tag

🔷 1. Introduction:

In HTML, the layout of content on the webpage can be controlled using margins.
The leftmargin and topmargin attributes of the <body> tag help adjust space on the left and top sides of the page.
These attributes create padding or empty space between the browser edge and the content.


🔷 2. Definition:

  • leftmargin: Sets space between the left edge of the browser and the webpage content.
  • topmargin: Sets space between the top of the browser and the webpage content.
    Both are written inside the opening <body> tag.

🔷 3. Syntax + Example (Code):

<body leftmargin="80" topmargin="60">
  <h1>Hello User</h1>
  <p>This text will appear with space from top and left.</p>
</body>

🔷 4. Output (What appears in browser):

  • The content (heading and paragraph) will appear shifted towards right and downward.
  • There will be 80px margin from the left and 60px margin from the top of the browser window.

🔷 5. Real Life Example:

Imagine a school project page.
You don’t want the content to touch the very edge of the screen.
So, you add leftmargin="50" and topmargin="40" to push everything inward and make it look cleaner.


🔷 6. Practical Notes:

  • These attributes are supported only in Internet Explorer and old browsers.
  • In modern web design, we use CSS for margins.
  • But for beginner-level HTML learning, they help understand page structure.

🔷 7. Advantages:

  • Easy to add spacing without using CSS
  • Simple syntax for beginners
  • Helps in adjusting content visually
  • Gives cleaner layout look

🔷 8. Limitations:

  • Deprecated in HTML5
  • Does not work in modern browsers like Chrome or Firefox
  • Better to use CSS (margin-left, margin-top) for future use

HTML Body टैग में Leftmargin और Topmargin Attributes

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

HTML में हम वेबपेज के कंटेंट को स्क्रीन के किनारे से कुछ दूरी पर दिखाना चाहते हैं,
तो इसके लिए हम leftmargin और topmargin attributes का प्रयोग करते हैं।
ये attributes कंटेंट को ऊपर और बाएं किनारे से खाली स्थान (spacing) देकर सुंदरता बढ़ाते हैं।


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

  • leftmargin: यह attribute वेबपेज और ब्राउज़र की बाईं किनारी के बीच में दूरी सेट करता है।
  • topmargin: यह attribute वेबपेज के कंटेंट और ब्राउज़र की ऊपर वाली सीमा के बीच दूरी सेट करता है।
    ये दोनों <body> टैग के अंदर दिए जाते हैं।

🔷 3. सिंटैक्स + उदाहरण (Syntax + Example):

<body leftmargin="80" topmargin="60">
  <h1>नमस्ते यूज़र</h1>
  <p>यह टेक्स्ट ऊपर और बाईं ओर से कुछ दूरी पर दिखाई देगा।</p>
</body>

🔷 4. आउटपुट (Output में क्या दिखेगा):

  • वेबपेज का टेक्स्ट बाएं से 80 पिक्सल और ऊपर से 60 पिक्सल दूरी पर दिखाई देगा।
  • ऐसा लगेगा कि कंटेंट थोड़ा अंदर खिसक कर लिखा गया है।

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

मान लीजिए एक छात्र अपनी HTML वेबसाइट बना रहा है और चाहता है कि टेक्स्ट पेज के एकदम किनारे पर ना हो।
तो वह <body leftmargin="50" topmargin="40"> लिखकर कंटेंट को थोड़ा अंदर खिसका देता है जिससे डिज़ाइन साफ-सुथरी लगती है।


🔷 6. प्रयोगात्मक जानकारी (Practical Notes):

  • ये attributes केवल Internet Explorer और पुराने ब्राउज़र्स में काम करते थे।
  • आज के समय में CSS का उपयोग किया जाता है:
    जैसे style="margin-left: 80px; margin-top: 60px;"
  • फिर भी, HTML के शुरुआती अभ्यास के लिए ये अच्छे उदाहरण हैं।

🔷 7. लाभ (Advantages):

  • बिना CSS के spacing देना आसान
  • शुरुआती छात्रों के लिए सरल प्रयोग
  • कंटेंट को साफ तरीके से सेट करने में सहायक
  • कोड छोटा और समझने लायक होता है

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

  • HTML5 में support नहीं है (deprecated)
  • Chrome, Firefox जैसे मॉडर्न ब्राउज़र में यह काम नहीं करता
  • भविष्य के डिज़ाइन के लिए CSS margin properties का प्रयोग ज़रूरी

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 *