Box Shadow on only 3 sides
        Posted  
        
            by 
                Connor
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Connor
        
        
        
        Published on 2012-04-07T22:57:58Z
        Indexed on 
            2012/04/07
            23:30 UTC
        
        
        Read the original article
        Hit count: 355
        
I have two overlapping divs that have css3 box shadows. The trouble is that even when I set the z-index I will still need to eliminate one of the div's box-shadow. I have seen cases where negative spreads and zero values are used but I don't think that would work here.
The code I have now is:
#bulb-top {
    position: relative;
    width: 280px;
    height: 280px;
    background-color: #E5F7A3;
    -webkit-border-radius: 280px;
    -moz-border-radius: 280px;
    border-radius: 280px;
    border: 8px solid #FFF40C;
    top: -430px;
    margin-left: auto;
    margin-right: auto;
    -webkit-box-shadow: 0px 0px 15px 1px #FFF40C;
    -moz-box-shadow: 0px 0px 15px 1px #FFF40C;
    box-shadow: 0px 0px 15px 1px #FFF40C;
    z-index: 4;
}
#bulb-bottom {
    position: relative;
    width: 140px;
    height: 120px;
    background-color: #E5F7A3;
    -moz-border-radius-topleft: 0px;
    -moz-border-radius-topright: 0px;
    -moz-border-radius-bottomright: 30px;
    -moz-border-radius-bottomleft: 30px;
    -webkit-border-radius: 0px 0px 30px 30px;
    border-radius: 0px 0px 30px 30px;
    border-left: 8px solid #FFF40C;
    border-right: 8px solid #FFF40C;
    border-bottom: 8px solid #FFF40C;
    top: -455px;
    margin-left: auto;
    margin-right: auto;
    -webkit-box-shadow: 0px 0px 15px 1px #FFF40C;
    -moz-box-shadow: 0px 0px 15px 1px #FFF40C;
    box-shadow: 0px 0px 15px 1px #FFF40C;
    z-index: 5;
}
        © Stack Overflow or respective owner