Recall & Review
beginner
What is the syntax for writing a comment in CSS?
A CSS comment starts with
/* and ends with */. Anything between these markers is ignored by the browser.Click to reveal answer
beginner
Can CSS comments be placed inside a CSS rule or only outside?
CSS comments can be placed anywhere in the CSS file, including inside CSS rules, between properties, or outside rules. They do not affect the styles.
Click to reveal answer
beginner
Why should you use comments in your CSS code?
Comments help explain your code to yourself and others. They make it easier to understand, maintain, and update styles later.
Click to reveal answer
beginner
Are CSS comments visible on the webpage when viewed in a browser?
No, CSS comments are not shown on the webpage. They are only visible in the CSS source code and ignored by the browser when rendering.
Click to reveal answer
intermediate
What happens if you forget to close a CSS comment?
If a CSS comment is not closed with
*/, the browser will treat the rest of the CSS file as a comment, causing styles to break or not apply.Click to reveal answer
Which of the following is the correct way to write a CSS comment?
✗ Incorrect
CSS comments start with /* and end with */. Other styles are used in different languages.
Can CSS comments be placed between CSS properties inside a rule?
✗ Incorrect
CSS comments can be placed anywhere, including inside CSS rules between properties.
What will happen if you forget to close a CSS comment?
✗ Incorrect
Without closing, the browser treats the rest of the CSS as comment, so styles won't apply.
Are CSS comments visible on the webpage when viewed by users?
✗ Incorrect
CSS comments are ignored by browsers and do not show on the webpage.
Why is it good to use comments in CSS?
✗ Incorrect
Comments help explain your code for yourself and others, improving maintenance.
Explain how to write a comment in CSS and why it is useful.
Think about how comments help you understand your own notes later.
You got /4 concepts.
Describe what happens if a CSS comment is not properly closed.
Imagine leaving a note open without an ending.
You got /3 concepts.