$('#element').css({'background-color':'none'});
The code above doesn't work. Is there a way to do it?
Yes. Since the initial value is transparent , that is what you use if you want to turn background coloring "off".
To set the opacity of a background, image, text, or other element, you can use the CSS opacity property. Values for this property range from 0 to 1. If you set the property to 0, the styled element will be completely transparent (ie. invisible).
If you just want your element to be transparent, it's really as easy as : background-color: transparent; But if you want it to be in colors, you can use: background-color: rgba(255, 0, 0, 0.4);
you can use one of these two options (i recommend the second one):
option 1:
$('#element').css('background-color','transparent');
option 2:
$('#element').css('background-color','inherit');
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