Drop shadow on a div container?

后端 未结 6 1228
温柔的废话
温柔的废话 2020-12-23 19:52

I have a searchbox with auto-suggest that pops a div up underneath it with multiple search string suggestions (like google). Is it possible to have drop shadow on the auto-

相关标签:
6条回答
  • 2020-12-23 20:11
    .shadow {
        -moz-box-shadow:    3px 3px 5px 6px #ccc;
        -webkit-box-shadow: 3px 3px 5px 6px #ccc;
        box-shadow:         3px 3px 5px 6px #ccc;
    }
    
    0 讨论(0)
  • 2020-12-23 20:15

    You can try using the PNG drop shadows. IE6 doesn't support it, however it will degrade nicely.

    http://www.positioniseverything.net/articles/dropshadows.html

    0 讨论(0)
  • 2020-12-23 20:16

    The most widely compatible way of doing this is likely going to be creating a second div under your auto-suggest box the same size as the box itself, nudged a few pixels down and to the right. You can use JS to create and position it, which shouldn't be terribly difficult if you're using a fairly modern framework.

    0 讨论(0)
  • 2020-12-23 20:16

    you might want to try this. Seems to be pretty easy and works on IE6 and Moz atleast.

    <div id ="show" style="background-color:Silver;width:100px;height:100px;visibility:visible;border-bottom:outset 1px black;border-right:outset 1px black;" ></div>
    

    The general syntax is : border-[postion]:[border-style] [border-width] [border-color] | inherit

    The list of available [border-style]s are :

    • dashed
    • dotted
    • double
    • groove
    • hidden
    • inset
    • none
    • outset
    • ridge
    • solid
    • inherit
    0 讨论(0)
  • 2020-12-23 20:21

    CSS3 has a box-shadow property. Vendor prefixes are required at the moment for maximum browser compatibility.

    div.box-shadow {
        -webkit-box-shadow: 2px 2px 4px 1px #fff;
        box-shadow: 2px 2px 4px 1px #fff;
    }
    

    There is a generator available at css3please.

    0 讨论(0)
  • 2020-12-23 20:31

    This works for me on all my browsers:

    .shadow {
    -moz-box-shadow: 0 0 30px 5px #999;
    -webkit-box-shadow: 0 0 30px 5px #999;
    }
    

    then just give any div the shadow class, no jQuery required.

    0 讨论(0)
提交回复
热议问题