3

我想在整个页面上创建一个垂直线阴影,如下所示:http: //i.stack.imgur.com/fsJCE.png。我已经尝试过 box-shadow 但是我仍然在顶部有一个阴影,我只希望它在图像的右侧。

我已经尝试过:

<html>
<head>
    <title>Box Shadow Test</title>
    <style>
    body,
html {
margin:0;
padding:0;
color:#000;
background:#52667B;
}
    wrapper {
        width:750px;
margin:0 auto;
background:#99c;
    }


    #main {
        padding-left: 50px;
float:left;
width:500px;
 -webkit-box-shadow: -4px 0px 5px -2px #000 ;
}
#sidebar {
float:left;
width:250px;

}
    </style>
</head>
<body>
    <div class="wrapper">
        <div id="sidebar" class="navigation">

    <ul>
        <li><a href='home'>Nieuws</a></li>
        <li><a href='events'>Duiken</a></li>
        <li><a href='places'>Duikplaatsen</a></li>
        <li><a href='reports'>Duikverslagen</a></li>
        <li><a href='forum'>Forum</a></li>
        <li><a href='gallery'>Galerij</a></li>
        <li><a href='faq'>FAQ</a></li>
        <li><a href='contact'>Contact</a></li>
    </ul>

        </div>
        <div id="main">
            Lorem ipsum aute commodo cupidatat veniam occaecat esse culpa exercitation dolore magna commodo enim eiusmod laboris est dolor laboris velit sint voluptate id cillum nisi quis aliqua ut labore consectetur Duis nisi occaecat do et cupidatat in aute labore nulla consequat dolore dolor consectetur cupidatat fugiat eiusmod tempor anim eiusmod dolor proident ex aute sunt Excepteur cupidatat fugiat nostrud irure id laboris ad enim nulla deserunt quis eu ullamco consectetur tempor nostrud magna quis ut ex minim id cupidatat amet culpa amet nisi Duis Duis irure irure ullamco est dolor culpa esse id in ut reprehenderit in esse pariatur in nostrud fugiat labore ut irure do in consectetur incididunt ullamco sint do occaecat dolor Ut pariatur non sint ut in incididunt id Duis aute nulla et eu ullamco in tempor non nisi reprehenderit sit reprehenderit et tempor officia sunt pariatur aliquip in pariatur labore veniam ad adipisicing velit aliqua aliqua cillum esse Duis pariatur eiusmod sed consectetur in cillum laborum dolor enim laborum qui velit pariatur adipisicing id aute cupidatat cupidatat quis anim tempor ad labore ad sunt minim laborum exercitation labore sunt quis nulla consequat Duis deserunt deserunt eiusmod aliqua sed in qui occaecat do velit reprehenderit dolor dolor cillum veniam dolor consectetur est commodo deserunt eu amet velit velit commodo est reprehenderit aute. 
        </div>
    </div>

</body>
</html>

但正如你在这张图片上看到的那样:http: //i.stack.imgur.com/01My9.png你在底部仍然有一些阴影。

任何人都知道如何做到这一点?

4

1 回答 1

1

首先,使用box-shadow代替 -webkit-box-shadow. 然后,只需使用这些值,直到你得到完美的阴影。

我试过这个:

盒子阴影:-5px 0px 5px -4px #000 ;

然后添加position:absolute;top:0_bottom:0;#main

演示:http:
//jsfiddle.net/magq5/1/

于 2012-06-18T12:07:48.093 回答