[英]CSS Nested Comment Multiline Code Comment Inside Other Comment
在CSS文件中,我有2種格式化body元素的方式。 如何評論以選擇身體樣式1?
/* body style 1 */
body {
background-color: #E6F6F6; /* color 1 */
}
/* I want to comment all from here to end */
/*
/* body style 2 */
body {
background-color: #F6F6F6; /* color 2 */
} /* this right bracket is not commented out */
p {
font-size: 10px;
}
*/
CSS注釋一直運行到* /的第一個實例。 您不能嵌套CSS注釋。
您可以做這樣的事情,但是很麻煩:
/* body style 1 */
body {
background-color: #E6F6F6; /* color 1 */
}
/* I want to comment all from here to end */
/*
/* body style 2 */
/*body {
background-color: #F6F6F6; /* color 2 */
/* } /* this right bracket is not commented out */
p {
font-size: 10px;
}
*/
刪除/*color 2*/
注釋和其他注釋,然后它將起作用
/* body style 1 */
body {
background-color: #E6F6F6;
}
/* I want to comment all from here to end */
/* body style 2 */
/*
body {
background-color: #F6F6F6;
}
p {
font-size: 10px;
}
*/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.