ankitweblogic logo
W e b t u t o r i a l s

Define CSS

CSS Comment

CSS Selectors

Types of CSS

CSS Color Property

CSS Font Property

CSS Background

CSS Box Model

CSS3 Border Radius

Styling HTML Table

Styling Links

CSS Menu

CSS Display and Visibility

CSS Overflow Property

CSS Position, Z-index

CSS Outline, Offset

CSS Cursor Property

CSS3 box-sizing

CSS Web Layout

CSS Website

Google Fonts

Google Map

Login Form

Google Page

Facebook Page

CSS Assignment List

CSS Comment

Comments are the text that are not rendered and ignored by the browser. Comments are used to explain the code, and helpful when you edit the source code later. There are 2 types of comments in CSS.

1. Single Line Comment: use to comment only one single line.

.class{
   color: gray;
   //font-size: 25px;
   background: lightgreen;  
   //this is single line comment;
}

In the above code font size is marked as comment, it will not executed.


2. Multi-line comment: A CSS multi-line comment starts with /* and ends with */. This type of comments is known as Multi-line comment.

.class{
  color:red;
  /*
  	font-size:30px;
    margin:25px;
  */
}

In the above code, font-size and margin property will not be executed both the lines are marked as comment.