我们可以在 CSS 中以多少方式和位置放置注释? [英] In how many ways and places we can place comment in CSS?

查看:23
本文介绍了我们可以在 CSS 中以多少方式和位置放置注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 我们可以通过多少方式和地点在 CSS 中放置注释?
  • 可以放置评论可以创建css 渲染中的任何问题和验证?
  • 如何在 Firebug 中显示评论?
  • 如何为 CSS 的大小变化写出好的注释
  • 如何使 CSS 可读、从注释中清除以便于管理

推荐答案

CSS 规范明确说明了这一点:

注释以字符 /* 开始,以字符 */ 结束.它们可能出现在令牌之间的任何地方,它们的内容对渲染没有影响.评论不能嵌套.

Comments begin with the characters /* and end with the characters */. They may occur anywhere between tokens, and their contents have no influence on the rendering. Comments may not be nested.

CSS 还允许在语法定义的某些地方使用 SGML 注释分隔符(),但它们不分隔 CSS注释.允许它们出现在 HTML 源文档中(在 STYLE 元素中)的样式规则可以对 HTML 3.2 之前的用户代理隐藏.有关详细信息,请参阅 HTML 4 规范 ([HTML4]).

CSS also allows the SGML comment delimiters (<!-- and -->) in certain places defined by the grammar, but they do not delimit CSS comments. They are permitted so that style rules appearing in an HTML source document (in the STYLE element) may be hidden from pre-HTML 3.2 user agents. See the HTML 4 specification ([HTML4]) for more information.

例如:

.row {background-color:#FFF;}  /* normal */
.row:hover {background-color:#CCC; /* grayed background */}
 
/* the title class */
.title{
    /* make font bigger */
    font-size: 160%;
}

这篇关于我们可以在 CSS 中以多少方式和位置放置注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆