css使用行内注释报错_在CSS中使用注释

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注释有用且专业。 除了明显的原因外, 样式表中的亵渎行为实际上可能会导致样式表停止在具有过于敏感的过滤器的计算机上工作 ,从而导致您的网站显示不完整。

翻译自: https://thenewcode.com/101/Using-Comments-In-CSS

css使用行内注释报错

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值