背景:无背景VS:透明 [英] background:none vs background:transparent

查看:96
本文介绍了背景:无背景VS:透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个区别悫这两个CSS属性:

 背景:无;
背景:透明;


  1. 是他们俩的有效

  2. 哪一个应使用和为什么


解决方案

有它们之间没有区别。

如果您不指定任何半打属性的值背景是一个速记,然后将其设置为默认值。 透明是默认值。

其中的背景图片明确设置为和隐式设置背景 - 颜色透明。另一种是周围的其他方法。

Is there a difference betwen these two CSS properties:

background: none;
background: transparent;

  1. Are they both valid?
  2. 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屋!

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