背景:无背景VS:透明 [英] background:none vs background:transparent
本文介绍了背景:无背景VS:透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一个区别悫这两个CSS属性:
背景:无;
背景:透明;
- 是他们俩的有效?
- 哪一个应使用和为什么?
解决方案
有它们之间没有区别。
如果您不指定任何半打属性的值背景
是一个速记,然后将其设置为默认值。 无
和透明
是默认值。
其中的背景图片
明确设置为无
和隐式设置背景 - 颜色
到透明
。另一种是周围的其他方法。
Is there a difference betwen these two CSS properties:
background: none;
background: transparent;
- Are they both valid?
- Which one should be used and why?
解决方案
There is no difference between them.
If you don't specify a value for any of the half-dozen properties that background
is a shorthand for, then it is set to its default value. none
and transparent
are the defaults.
One explicitly sets the background-image
to none
and implicitly sets the background-color
to transparent
. The other is the other way around.
这篇关于背景:无背景VS:透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文