CSS COMMENTS
CSS COMMENTS
Comments are used to explain the code, and give programmers aid and cues about such codes. Therefore comments are ignored by browsers. A CSS comment starts with /* and ends with */:
Example /* This is a single-line comment */
p { color: red; } You can add comments wherever you want in the code:
Example
p { color: red; /* Set text color to red */ } Comments can also span multiple lines:
Example /* This is
a multi-line
comment */
p { color: red; }
In the following example, we use a combination of HTML and CSS comments:
<!DOCTYPE html>
<html>
<head>
<style>
p {
font-size: 20px; /* Set text color to red */
}
</style>
</head>
<body>
<!-- These paragraphs will increase in font size -->
<h1> Datikvah World! </h1>
<p>CSS comments are not shown in the output.</p>
</body>
</html>