HTML and CSS Certification Practice Test 2025 - Free HTML and CSS Practice Questions and Study Guide

Question: 1 / 400

What do you use to create a comment in HTML?

<!-- comment -->

To create a comment in HTML, the correct syntax is to use the format that begins with `<!--` and ends with `-->`. This allows the content within the comment tags to be ignored by the browser and not displayed on the webpage. Comments are an essential part of HTML as they can be used to annotate the code for better readability and maintainability without affecting the rendering of the page.

The other options presented do not conform to the proper syntax for comments in HTML. Using `<comment> text </comment>` suggests that "comment" could be a standard HTML tag, which it isn't. The option `<# comment >` uses a syntax similar to how comments might be denoted in programming languages like CSS or other contexts, but it does not apply to HTML. Finally, while `<!--- comment --->` resembles the correct comment syntax, the presence of an extra hyphen is not valid and would not be recognized as a proper comment by the HTML parser. Thus, the first option is the only accurate representation of how to write comments in HTML.

Get further explanation with Examzify DeepDiveBeta

<comment> text </comment>

<# comment >

<!--- comment --->

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy