Home > Article > Web Front-end > How to comment in css
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.
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!