垂直线与阴影

时间:2012-06-18 11:48:35

标签: html css

我想在整个页面上创建一个垂直线阴影,如下所示:http://i.stack.imgur.com/fsJCE.png。我已经尝试了盒子阴影,但那时我仍然在顶部有一个阴影,我只想在右侧像图像一样。

我试过了:

<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你底部还有一些阴影。

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

1 个答案:

答案 0 :(得分:1)

首先,使用box-shadow代替-webkit-box-shadow。而且,只要玩这些值,直到你得到完美的阴影。

我试过了:

  

box-shadow:-5px 0px 5px -4px#000;

然后将position:absolute;top:0以及bottom:0;添加到#main

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