|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello
I have a background image in my web site which is centered and fixed with no repeat. I would like to make it some what transparent. I know that it can be done by manipulating the image itself, but I need to do it dynamically using CSS. I tried adding the filter pque(alpha=0.5 style=0) attribute to the body but that made all the elements in the body (except for background image) transparent.does anyone know how I can do it? |
|
#2
|
||||
|
||||
|
i may be able to help you.
what you do, is place a <div> that spans across all of the width and height of the screen that has the filter and whose background-color matches that of your entire pages background-color: Code:
<div style="background: #ffffff; width: 100%; height: 100%; position: absolute; top: 0%; left: 0%; z-index: -1000; filter: alpha(Opacity=47);"></div> just add that anywhere within your body after youve changed the background: attribute and then from there you can test out how little opacity you want it to have. if you need any additional help, just ask. [[[terminal]]] |
|
#3
|
|||
|
|||
|
it's a nice solution, but the problem is that when I set:
<div style="background-color:#003399; width: 100%; height: 100%; position: absolute; top: 0%; left: 0%; z-index: -1000; filter: alpha(Opacity=20);"></div> Then the div streches itself from the (0,0) cooridnate all the way to the right, but it goes down only until it reaches the first element. if I set the width and height to actual sizes in pixel it works fine, but the problem is that I don't know what the user's resolution would be and thus I cannot determine the size of the dive. The percentage option looks more promising, but it seems that the solution still need a bit more twicking. |
|
#4
|
||||
|
||||
|
hmm...ic....well...there has got to be some type of javascript solution...im thinking making this div static so that when you scroll, it goes down with it, that is, if thats the problem youre talkin bout..
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > how to have a transparent background image in CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|