i am trying to creating a text editor using html ,css and javascript.But i need to make background as transparent.how do i make it using css.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @Rijin,
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);
Or define a background image (1px by 1px) saved with the right alpha.
(To do so, use Gimp, Paint.Net or any other image software that allows you to do that.
Just create a new image, delete the background and put a semi-transparent color in it, then save it in png.)
The best thing to do would be to mix both, with the rgba first and the 1px by 1px image as a fallback if the browser doesn’t support alpha :
background: url('img/red_transparent_background.png');
background: rgba(255, 0, 0, 0.4);
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.