background:none vs background:transparent what is the difference?

后端 未结 3 1869
情歌与酒
情歌与酒 2020-12-07 11:43

Is there a difference between these two CSS properties:

background: none;
background: transparent;
  1. Are they both val
3条回答
  •  無奈伤痛
    2020-12-07 11:53

    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.

提交回复
热议问题