Can anyone tell me if the following CSS is valid?
.class { background-color:none; }
background-color: red; background-image: url(../img. jpg); background-repeat: no-repeat; background-attachment: fixed; background-position: 0 0; So... when you set: background:none; you are saying that all the background properties are set to none...
The background-color property in CSS is used to specify the background color of an element. The background covers the total size of the element with padding and border but excluding margin. It makes the text so easy to read for the user.
The W3C HTML and CSS standards have listed only 16 valid color names: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.
Background-color values can be expressed in hexadecimal values such as #FFFFFF, #000000, and #FF0000. Background-color values can be expressed using rgb such as rgb(255,255,255), rgb(0,0,0), and rgb(255,0,0).
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.
No, use transparent
instead none
. See working example here in this example if you will change transparent
to none
it will not work
use like .class { background-color:transparent; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With