HTML Comments
HTML Comments
Comments are useful information about the HTML elements. Comments makes the HTML document more readable and understandable.
Comments are ignored by the browser and are not displayed.
Comments start with <!--
and end with -->
.
There is an exclamation mark after the opening bracket, but
not before the closing bracket.
<!-- This is a comment-->
The content between >!--
and --<
is comments.
The browser will just ignore it.
The following html document has a comment.
<!DOCTYPE HTML>
<html>
<body>
<!-- This is a comment. -->
<p>This is a regular paragraph</p>
</body> <!-- ww w. j a v a 2 s . c om-->
</html>
The code above generates the following result.
HTML CSS Tutorial HTML CSS Basic
HTML Introduction
HTML Documents
HTML Element
HTML Attributes
HTML Core Attributes
HTML Paragraphs
HTML Rules (Lines)
HTML Line Breaks
CSS Introduction
CSS Syntax
CSS Color
CSS Lengths
CSS Comments
CSS selector
Grouping/nesting Selectors
Add CSS to HTML
Compare em measurement and pixel measuremen...
Select class along with tag name in HTML an...
Select Next Sibling with Next Sibling Selec...
Select with Descendant Selectors in HTML an...
Set color to purple in HTML and CSS
Set color with rgb function in HTML and CSS
Set text color for body element in HTML and...
Show the difference between block and inlin...
HTML Introduction
HTML Documents
HTML Element
HTML Attributes
HTML Core Attributes
HTML Comments
HTML HeadingsHTML Paragraphs
HTML Rules (Lines)
HTML Line Breaks
CSS Introduction
CSS Syntax
CSS Color
CSS Lengths
CSS Comments
CSS selector
Grouping/nesting Selectors
Add CSS to HTML
Compare em measurement and pixel measuremen...
Select class along with tag name in HTML an...
Select Next Sibling with Next Sibling Selec...
Select with Descendant Selectors in HTML an...
Set color to purple in HTML and CSS
Set color with rgb function in HTML and CSS
Set text color for body element in HTML and...
Show the difference between block and inlin...