I'm not using CSS3. So I can't use opacity
or filter
attributes. Without using these attributes how can I make the background-color
transparent of a div
? It should be kind of the text box example in this link. Here the text box background color is transparent. I want to make the same, but without using the above mentioned attributes.
Html – How to make div background color transparent in CSS
background-colorcsshtmltransparent
Related Topic
- Html – How to give text or an image a transparent background using CSS
- Html – How to make a div 100% height of the browser window
- Html – Change a HTML5 input’s placeholder color with CSS
- Html – How to auto-resize an image to fit a ‘div’ container
- Css – How to transition height: 0; to height: auto; using CSS
- Html – How to make a placeholder for a ‘select’ box
- Css – How do CSS triangles work
Best Answer
The problem with
opacity
is that it will also affect the content, when often you do not want this to happen.If you just want your element to be transparent, it's really as easy as :
But if you want it to be in colors, you can use:
Or define a background image (
1px
by1px
) saved with the rightalpha
.(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.)
As said by René, the best thing to do would be to mix both, with the
rgba
first and the1px
by1px
image as a fallback if the browser doesn't support alpha :See also : http://www.w3schools.com/cssref/css_colors_legal.asp.
Demo : My JSFiddle