HTML डिप्रिकेटेड टैग्स
In this page:
ये टैग्स डिप्रिकेट क्यों किए गए
शुरुआती HTML में content structure और visual presentation एक ही tags में मिले-जुले होते थे, यानी किसी page की styling सीधे उसके markup में ही बेक हो जाती थी।
जैसे-जैसे CSS एक पूर्ण, dedicated styling language के रूप में विकसित हुई, HTML ने ज़्यादातर presentational tags को deprecate कर दिया ताकि structure (HTML) और style (CSS) को साफ-साफ अलग रखा जा सके -- यह सिद्धांत sites को maintain और restyle करना आसान बनाता है।
उदाहरण: Why These Tags Were Deprecated
<!-- Old: presentation mixed into markup -->
<font color="red">Warning text</font>
<!-- Modern: structure and style separated -->
<p style="color: red;">Warning text</p>
बदले जाने वाले टेक्स्ट स्टाइलिंग टैग्स
<font>, <basefont>, <big>, <tt>, और <strike> ये सभी markup में सीधे font family, size, color, या basic text effects control करते थे।
हर एक का सीधा CSS replacement है: <font> और <basefont> के लिए font-family/color/font-size, <big> के लिए font-size, <tt> के लिए font-family: monospace, और <strike> के लिए text-decoration: line-through (या semantic <s> element)।
उदाहरण: Text Styling Tags to Replace
<!-- Deprecated -->
<font size="5" color="blue">Big blue text</font>
<strike>Old price</strike>
<!-- Replacement -->
<span style="font-size: 20px; color: blue;">Big blue text</span>
<s>Old price</s>
बदले जाने वाले लेआउट टैग्स
<center> और <marquee>-era layout tags markup में सीधे specific visual positioning थोपते थे। <center> की जगह text-align: center (text के लिए) या margin: 0 auto (किसी block element को centre करने के लिए) इस्तेमाल होता है, जबकि deprecated attributes वाले table-based layouts की जगह पूरी तरह CSS Flexbox या Grid लेते हैं।
उदाहरण: Layout Tags to Replace
<!-- Deprecated -->
<center>Centered text</center>
<!-- Replacement -->
<p style="text-align: center;">Centered text</p>
बदले जाने वाले Frame और Embed टैग्स
<frame>, <frameset>, और <noframes> browser window को कई independently-scrolling documents में बाँटते थे, जो अब <iframe> (एक external document embed करने के लिए) या CSS Grid/Flexbox layouts (एक ही page को visual regions में बाँटने के लिए) से बदल दिए गए हैं। <applet> (Java applets) की जगह किसी बचे हुए plugin content के लिए <embed> या <object> इस्तेमाल होता है, हालाँकि आधुनिक web apps browser plugins से पूरी तरह बचते हैं।
उदाहरण: Frame and Embed Tags to Replace
<!-- Deprecated -->
<frameset>
<frame src="page1.html">
</frameset>
<!-- Replacement -->
<iframe src="page1.html"></iframe>
क्विक रेफरेंस: डिप्रिकेटेड टैग से मॉडर्न रिप्लेसमेंट
एक तेज़ lookup के रूप में: <acronym> से <abbr>, <applet> से <embed>/<object>, <basefont>/<font> से CSS font properties, <big>/<small> visual sizing से CSS font-size, <center> से CSS text-align/margin, <dir> से <ul>, <frame>/<frameset>/<noframes> से <iframe> या CSS layout, <strike> से <s> या <del>, और <tt> से <code> या CSS font-family: monospace।
उदाहरण: Quick Reference: Deprecated Tag to Modern Replacement
<!-- <acronym> -> <abbr> -->
<abbr title="HyperText Markup Language">HTML</abbr>
<!-- <tt> -> <code> -->
<code>console.log()</code>
Chapter Quiz — Complete all 9 topics to unlock
0/9 topics done
Complete these topics first: