css使用行内注释报错
It is a very good working practice to comment your code in CSS. Comments serve two major functions:
在CSS中注释您的代码是非常好的工作习惯。 注释具有两个主要功能:
-
As notes and reminders
作为笔记和提醒
- Comments allow you leave yourself notes as to what sections of your stylesheet do, and what they are there for. It is common, as both a freelance and full-time developer, to return to CSS that you have not seen in six months or more: comments allow you to quickly remember what each piece of code does.
- 注释使您可以对样式表的各个部分以及它们的用途进行注释。 无论是自由职业者还是专职开发人员,通常都会回到六个月或更长时间未见CSS:注释使您可以快速记住每段代码的功能。 As “traffic cones” around code that is problematic 作为有问题的代码周围的“交通锥”
-
Content, markup and code within comments does not appear on a web page, but can still be read by anyone what access to your source code. (In CSS, that is as easy as using View CSS in the Web Developer toolbar.
注释中的内容,标记和代码不会显示在网页上,但是任何可以访问您的源代码的人都可以阅读。 (在CSS中,这就像在Web Developer工具栏中使用View CSS一样容易。
注释语法 (Comment Syntax)
/* This is a CSS comment */
CSS comments may also be broken over multiple lines:
CSS注释也可以分为多行:
/* p { font-color: black; }
hr { color: red; }
both of the above lines will be ignored, together with this one */
It’s worthwhile to stress that, just like HTML comments, you should keep your CSS comments useful and professional. In addition to the obvious reasons, profanity in stylesheets can actually cause them to stop working on computers with overly-sensitive filters, leading to a broken presentation of your website.
值得强调的是,就像HTML注释一样,您应该保持CSS注释有用且专业。 除了明显的原因外, 样式表中的亵渎行为实际上可能会导致样式表停止在具有过于敏感的过滤器的计算机上工作 ,从而导致您的网站显示不完整。
css使用行内注释报错