html - 底部 body 上的盒子阴影

标签 html css

使用此代码,我可以在窗口顶部应用阴影:http://jsbin.com/awedir/1/edit

但我想要它在底部。那么我该如何实现呢?

body:before 
{ 
   content: "";
   position: fixed;
   top: -10px;
   left: 0;
   width: 100%;
   height: 10px;
   z-index: 100;
   -webkit-box-shadow: 0px 0px 10px rgba(0,0,0,.8);
   -moz-box-shadow: 0px 0px 10px rgba(0,0,0,.8);
   box-shadow: 0px 0px 10px rgba(0,0,0,.8);
   }

最佳答案

好的,从评论延伸:

只需“反转”您使用 ::before 的方式:

http://jsbin.com/uyosuk/1

body::after
{ 
   content: "";
   position: fixed;
   bottom:-10px;
   left: 0;
   width: 100%;
   height: 10px;
   z-index: 100; 
   box-shadow: 0px 0px 10px rgba(0,0,0,.8);
}

关于html - 底部 body 上的盒子阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17267585/

相关文章:

css - 使用 WebKit 时出现奇怪的 `clear: both;` 错误

css - 如何用CSS慢慢改变比例?

java - 在servlet上上传 Canvas base64图像

html - ngFor 在传递数组时抛出错误

javascript - 访问网络摄像头视频流的像素 (JS/WebRTC/MediaStreamTrack)

javascript - AngularJS 脚本运行了两次

css 和图像未显示在 wordpress 编辑 View 中

html - 方向变化导致字体大小变化

html - 使用两个背景图像时的 CSS 属性

javascript - 如何使用css和js为div中的每个图像制作图像控制按钮?