Results 1 to 4 of 4

Thread: how to make transparent layer over an image ??

  1. #1
    Join Date
    May 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to make transparent layer over an image ??

    Hello forums !!
    I had an image which is kept @ the background of a table.
    I want to make a layer over that image ie transpaernt layer .
    How to make that transparent layer using css ?
    Any idea?
    Awaiting for you help.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    i dont really see the purpose, but maybe you are not divulging everything so all you need to do is create a new tag be it <div> or a <p> or a <span> depending on what you really need it for, then you can just use some absolute positioning and viola you have a layer over whatever you want.

  3. #3
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    To add to what boogyman said, I probably would have the transparent layer and the image within their own block level tag (div woud be fine) so that absolute positioning would set them neatly on top of each other
    Code:
    <div>
    <img src="test.bmp" alt="" style="position:absolute;" />
    <div style="position:absolute;width:Xpx;height:Ypx;background-color:#000000;filter:alpha(opacity=0);opacity:0;-moz-opacity:0;"></div>
    </div>
    Where I have Xpx and Ypx, change those values to the dimension of your image.

    The reason I set background-color to black and the opacity stuff to 100&#37; clear is because I'm assumming you want this transparent layer so people can't save the image? This prevents it (to an extent).

    You could also try using background-image as well if your intent is different.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    That only makes it so that people cannot right click on the image and save it. Anyone who wants to steal your image will know of other ways, from the source code, to the cache, to print screen.

    I think more information on the purpose would be helpful. I'm still not quite sure what you mean. I'd assume you mean translucent (semi-transparent), not completely clear, since that seems like a waste. However, you might need an image you cannot see but use for function, such as using an image map on it. That might work.

    Again, give us a little more information on why you need this and we'll see if there's another creative solution.


    The easiest way to have a transparent image is to use a gif. A png works too, but has little support in IE before IE7. There are ways around this if needed.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •