HTML - Comment in Hindi




दोस्तों इस chapter में हम HTML comment के बारे में जानेंगे तो चलिए शुरू करते है, HTML में comment web ब्राउज़र पर show नहीं होते है लेकिन वो documentation के time हमारी help करते है अगर हम HTML comment tag के अंदर कोई भी information रखते है तो उस information को web ब्राउज़र ignore कर देता हैं।

HTML comment किसी भी HTML दस्तावेज़ में कहीं पर रखा जा सकता हैं। लेकिन हमारे सुझाव हैं, DOCTYPE से पहले इसे मत रखें। HTML comment को nested नहीं किया जा सकता है, अर्थात एक comment के भीतर एक और comment को नहीं रखा जा सकता है।

Comments के माध्यम से code को समझने की क्षमता बढ़ जाती है. दोस्तों आप comments के अंदर specified Information को भी लिख सकते हो। इस मामले में वे web document पर प्रदर्शित नहीं होंगे और user के लिए show नहीं होंगे।

दोस्तों HTML comments को <!-- --> tag के बीचे में लिखा जाता है, दिए हुए comments को browser द्वारा वेब पेज पर display नहीं किया जाता है इसको वेब browser द्वारा ignore कर दिया जाता है।

Types of Comment

  • Single Comments

  • Multiline Comments

  • Conditional Comments

Single Comments

Example

<!DOCTYPE html>
<html>
<body>
<!-- This Is Single Line Comment -->
<p>This is My paragraph</p>
</body>
</html>

Result

This is My paragraph

Multiple Line Comment

Example

<!DOCTYPE html>
<html>
<body>
<!-- This 
Is 
Multiple Line Comment -->
<p>This is My paragraph</p>
</body>
</html>

Result

This is My paragraph