

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
CSS Comments
<p style="">We can write comments for CSS declarations to help improve readability and make it more understandable. CSS follows C language style syntax for comments which start and end with forward slash between which the content is enclosed in asterisks. Any declaration written inside /**/ is ignored.</p><h2>Syntax</h2><p>The syntax of CSS comments is as follows −</p><pre class="result notranslate">/*Comments*/</pre><p>The following examples illustrate CSS comments −</p><h2>Example</h2><p><a class="demo" href="http://tpcg.io/cLpE9qzK" rel="nofollow" target="_blank"> Live Demo</a></p><pre class="prettyprint notranslate" style=""><!DOCTYPE html> <html> <head> <style> ul { list-style: none; /*To remove the solid circles*/ } </style> </head> <body> <ul> <li>Σ1</li> <li>Σ2</li> <li>Σ3<li> </ul> </body> </html></pre><h2>Output</h2><p>This gives the following output −</p><p style=""><img src="https://www.tutorialspoint.com/assets/questions/media/33934/CSS_Comments.jpg" class="fr-fic fr-dib" style="width: 485px; height: 112.358px;" width="485" height="112.358"></p><h2>Example</h2><p><a class="demo" href="http://tpcg.io/fxfY9pCS" rel="nofollow" target="_blank"> Live Demo</a></p><pre class="prettyprint notranslate" style=""><!DOCTYPE html> <html> <head> <style> div {/*this <div> selects all >div> elements and the declares the following*/ margin: 8px; float: left; width: 100px; height: 100px; /*border: 2px solid black;*/ /*removed border*/ background-color: lightpink; } div + div { /*this makes a circle*/ border-radius: 50%; } </style> </head> <body> <div></div> <div></div> </body> </html></pre><h2>Output</h2><p>This gives the following output −</p><p style=""><img src="https://www.tutorialspoint.com/assets/questions/media/33934/CSS_Comments1.jpg" class="fr-fic fr-dib" style="width: 450px; height: 123.957px;" width="450" height="123.957"></p>
- Related Questions & Answers
- Java comments.
- HTML Comments
- Comments in Java
- Comments in C#
- Java documentation comments
- Comments in Perl
- Comments in Python
- Executable Comments in Java
- Comments in C/C++
- Explain Comments in JavaScript
- /** and /* in Java comments
- Types of Java comments.
- Java single line comments.
- Java multi-line comments
- What are JSP comments?
Advertisements