Is there a difference between these two CSS properties:
background: none;
background: transparent;
- Are they both valid?
- Which one should be used and why?
Is there a difference between these two CSS properties:
background: none;
background: transparent;
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.