是background-color:none有效的CSS吗? [英] Is background-color:none valid CSS?

查看:616
本文介绍了是background-color:none有效的CSS吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我以下CSS是否有效?

  .class {
background-color:none ;
}


解决方案

$ c> transparent 作为 none 不是有效的 background-color p>

CSS 2.1规范 background-color 属性指定以下内容:


值:< color> |透明|继承


< color> 关键字或颜色的数字表示。 有效的颜色关键字是:


aqua,黑色,蓝色,紫红色,灰色,绿色,紫色,红色,银色,蓝绿色,白色和黄色


transparent inherit 是有效的关键字,但 none 不是。


Can anyone tell me if the following CSS is valid?

.class {
    background-color:none;
}

解决方案

You probably want transparent as none is not a valid background-color value.

The CSS 2.1 spec states the following for the background-color property:

Value: <color> | transparent | inherit

<color> can be either a keyword or a numerical representation of a colour. Valid color keywords are:

aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow

transparent and inherit are valid keywords in their own right, but none is not.

这篇关于是background-color:none有效的CSS吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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