#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Background shadow of a div container


    Hi all, I would need to change the background of a div container. Its transparent but I would need to make it a little bit with shadow like this example
    natur-zen.fr/naturist-massage-a-la-pen-l-flight-of-way.htm

    *** WARNING: Link is Not Work-Safe ***

    Notice how the background of the box is still transparent, but it has like a shadow.

    How could I do that?

    Thanks
    Last edited by Kravvitz; October 30th, 2012 at 12:11 AM. Reason: added warning about the link
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    13
    Rep Power
    0
    If I understand correctly, you want a partially transparent background color. For this you will have to use the rgba model, "a" meaning "alpha" which is the transparency amount. Alpha is written in a decimal.

    Code:
    #div {
         background-color: rgba(255,0,0,.5);
    }
    This example will have a pink background, because 255,0,0 is pure read and .5 alpha means 50% transparent.

    Preview here:

    htmledit.squarefree.com

    Insert this into the website mentioned above:
    Code:
    <div style=background-color:rgba(255,0,0,.5);>hi</div>

IMN logo majestic logo threadwatch logo seochat tools logo