Is there a way to set the background of an element to none?
for example it is #000 in the full size screen
but when after an @media query change i want the same div to have no background.
or can i set the rgb to a neutral value? is there such a thing.
thx
D
If you want to remove a background color, you can use:
background-color:none;
or
background:none;
fantastic
for some reason i thought i had been told years that wasn’t an option.
created an addy class w/background none & it worked great.
Thank you!!!
but when after an @media query change i want the same div to have no background
Another option would be to set that background color in a media query that only targets larger screens.
I’m afraid that won’t work as there is no value called"none " for the background-color property. I think you meant to say transparent which will set it back to default.
body{
background-color:red;
background-color:transparent;
}
“none” is available for background-image which is why the shorthand works with “none”.
background:none;
“none” refers to the background-image and as usual with shorthand anything not specified will be reset to the default for which the default of background-color is transparent