CSS Comments

CSS comments are not displayed in the browser, but they can help document your source code.

CSS comments are generally written to explain your code. It is very helpful for the users who reads your code so that they can easily understand the code.

Comments are ignored by browsers.

A CSS comment is placed inside the <style> element, and starts with /* and ends with */:

Example :

<style>
h1{
  color: #006600; /* Set text color to green */
}
</style>

Also multiple lines statement and written within /*............*/

Example :

<style>
h1{
  /* You can set color
  Also you can set font size
  Also you can set text alignment */    
  color: #CC0000;
  font-size:12px;
  text-align:center;
}
</style>

 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

50891