Home  >  Article  >  Web Front-end  >  How to comment in css

How to comment in css

王林
王林Original
2021-05-13 16:11:2412673browse

The way to comment in CSS is to use the symbols [/**/], for example [/*define the header style of the web page*/]. In CSS, all text information placed between the [/*] and [*/] delimiters are called comments.

How to comment in css

The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.

Adding comments in CSS is very simple. All text information placed between the /* and */ delimiters are called comments.

CSS has only one kind of comment. Whether it is a multi-line comment or a single-line comment, it must start with /* and end with */, and add the comment content in the middle.

[Example 1] Comments are placed outside the style sheet.

/*定义网页的头部样式*/
.head{
width: 960px;
}
/*定义网页的底部样式*/
.footer 
{width:960px;
}

[Example 2] Comments are placed inside the style sheet.

p{
color: #ff7000;  /*字体颜色设置*/
height:30px;  /*段落高度设置*/
}

Learning video sharing: css video tutorial

The above is the detailed content of How to comment in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn