O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Comments to Style Rules

It’s a good idea to add comments to your CSS to note the primary sections of your style sheets or simply to explain something about a particular rule or declaration. Comments help not only you but also others who are viewing your code. For your own sake, you’ll be happy that you left yourself comments if you revisit the code some months after having initially worked on it.

To add comments to style rules

1. In your style sheet, type /* to begin your comment.

2. Type the comment.

3. Type */ to signal the end of the comment.

Tip

Comments may include returns and thus span several lines Image.

Comments can be long or short, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required