Adding comments to your code is a helpful way to include notes that explain to you or others what the code does. Code or other text that is commented out is ignored by the browser.
How to write comments in HTML
Single line HTML comments
To comment a single line in HTML, place that snippet of code between the tags : <!-- -->.
Multiline HTML comments
To comment multiline in HTML, you can still use the above syntax (<!-- -->). But keep in mind that, it comments out the whole text and the tags in between, so add it carefully.
How to write comments in CSS
Single line CSS comments
To make a single line CSS comment, put the comment text or code between /* */tags.
Multiline CSS comments
To write multiline or block CSS comments, you can use the same /* */ tags, and put the comment content on multiple lines.
How to write comments in JavaScript
Single line JavaScript comments
To create a single line comment in JavaScript, begin the line with two forward slashes (//).
Multiline JavaScript comments
If you want to create a multiline or block comment in JavaScript, enclose the comment text between /* */ tags.
________________________________________________
Liked By
Write Answer
Single and multiline comment in HTML, CSS and JavaScript
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
04-Aug-2021Adding comments to your code is a helpful way to include notes that explain to you or others what the code does. Code or other text that is commented out is ignored by the browser.
How to write comments in HTML
Single line HTML comments
To comment a single line in HTML, place that snippet of code between the tags : <!-- -->.
Multiline HTML comments
To comment multiline in HTML, you can still use the above syntax (<!-- -->). But keep in mind that, it comments out the whole text and the tags in between, so add it carefully.
How to write comments in CSS
Single line CSS comments
To make a single line CSS comment, put the comment text or code between /* */tags.
Multiline CSS comments
To write multiline or block CSS comments, you can use the same /* */ tags, and put the comment content on multiple lines.
How to write comments in JavaScript
Single line JavaScript comments
To create a single line comment in JavaScript, begin the line with two forward slashes (//).
Multiline JavaScript comments
If you want to create a multiline or block comment in JavaScript, enclose the comment text between /* */ tags.
________________________________________________