Sass注释: /* */ 和 //_html/css_WEB-ITnose
程序员文章站
2022-05-22 21:27:02
...
翻译自Sass官方文档: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#comments
Sass 支持标准的CSS多行注释以 /* */以及单行注释 //。在尽可能的情况下,多行注释会被保留在输出的CSS中,而单行注释会被删除。 例如:
/* This comment is * several lines long. * since it uses the CSS comment syntax, * it will appear in the CSS output. */body { color: black; }// These comments are only one line long each.// They won't appear in the CSS output,// since they use the single-line comment syntax.a { color: green; }
编译为:
/* This comment is * several lines long. * since it uses the CSS comment syntax, * it will appear in the CSS output. */body { color: black; }a { color: green; }
如果多行注释的第一个字母是 !,那么注释总是会被保留到输出的CSS中,即使在压缩输出模式下。这可用于在你生成的CSS中添加版权声明。
使用插值语句 (interpolation) ,可以将变量值输出到多行注释中,例如:
$version: "1.2.3";/* This CSS is generated by My Snazzy Framework version #{$version}. */
编译为:
/* This CSS is generated by My Snazzy Framework version 1.2.3. */
上一篇: 没见过这种时间格式,如何用PHP格式化它
下一篇: MySQL数据库入门大盘点
推荐阅读
-
HTML标题重要性与html水平线和注释
-
css3中的content和实体_html/css_WEB-ITnose
-
jinja2模版生成页面时会产生大量空行和空格,如何移除?_html/css_WEB-ITnose
-
CSS 过滤器 兼容ie,火狐和谷歌_html/css_WEB-ITnose
-
使用 XPATH 和 HTML Cleaner 解析 HTML/XML(Using XPATH and HTML Cleaner to parse HTML / XML)_html/css_WEB-ITnose
-
自学篇之js 提取复选框和单选框的值 和纯css的3D按钮_html/css_WEB-ITnose
-
在网页里嵌入swf文件,如何让swf文件的高度和宽度能自动适应_html/css_WEB-ITnose
-
css基准线研究:垂直对齐的实现-好的、差的和丑陋的_html/css_WEB-ITnose
-
tips 前端 背景与元素的透明和模糊_html/css_WEB-ITnose
-
<和>_html/css_WEB-ITnose