Comments in HTML
Comments in HTML
Comments दिया हुआ HTML का code समझने के लिए single या multiple lines में दिया जाता है | Comments के माध्यम से code को समझने की क्षमता बढ़ जाती है | Comments को browser द्वारा ignore किया जाता है |
HTML Comments को <!-- और --> के बीचे में लिखा जाता है |
Types of HTML Comment
· Single Line Comment
· Multi Line Comment
· Conditional Comment
SINGLE LINE COMMENT
जब HTML Document में सिर्फ एक Line पर कमेंट किया जाता है, उसे Single Line Comment कहते है l
Example for Single Line Comment in HTML
<!DOCTYPE html>
<html>
<body>
<!-- this is single line comment -->
<p>Hello World</p>
</body>
</html>
MULTI LINE COMMENT
जब HTML Document में एक
से ज्यादा Lines पर Comment किया जाता है,
तो इसे Multi
Line Comment कहते है
l इसका उपयोग एक Paragraph या अधिक Paragraphs को Describe
या एक साथ Users से छिपाने के लिए किया जाता है
l
Example for Multiple Line Comment in HTML
<!DOCTYPE html>
<html>
<body>
<!-- this
is
multiple line comment -->
<p>Hello World</p>
</body>
</html>
CONDITIONAL COMMENT
इस प्रकार के Comments को Internet Explorer Browser के लिये लिखा जाता है l अन्य ब्राउजर Conditional Comments को Ignore कर देते है l Conditional Comment द्वारा IE Browser के अलग-अलग Versions के लिये Conditional Instructions लिखे जाते है l
<!DOCTYPE html>
<html>
<head>
<–[if IE 7]
Special Instructions Goes Here…
<![endif]–>
</head>
<body>
</body>
</html>
Post a Comment