Home >Web Front-end >Front-end Q&A >How to comment out css code
The way to comment out css code is to start with the "/*" symbol and end with the "*/" symbol; examples of css comment code are such as "/* This is a single line comment */p {color: red; }", you can also add comments anywhere in the code, comment code such as "p {color: red; /* Set the text to red*/}".
The operating environment of this tutorial: Windows 10 system, CSS3 version, DELL G3 computer
How to comment out the css code?
CSS Comments
Comments are used to explain the code and may be helpful later when you edit the source code.
Browsers will ignore comments.
CSS comments located within the c9ccee2e6ea535a969eb3f532ad9fe89 element, starting with /* and ending with */:
Example
/* 这是一条单行注释 */ p { color: red; }
Comments can be added anywhere in the code :
Example
p { color: red; /* 把文本设置为红色 */ }
Comments can span multiple lines:
Example
/* 这是 一条多行的 注释 */ p { color: red; }
Recommended study: "css video tutorial"
The above is the detailed content of How to comment out css code. For more information, please follow other related articles on the PHP Chinese website!