简体   繁体   English

框阴影到div容器

[英]box shadow to a div container

I'm trying to achieve a box div with box shadow effect. 我正在尝试实现具有框阴影效果的box div。

I managed to do it on css though for some reason the container doesn't look aligned with my grid of squares. 我设法在CSS上做到了这一点,尽管由于某种原因,容器看上去与我的正方形网格不一致。 If anyone could check what I am doing wrong that would be great! 如果有人可以检查我在做什么错,那太好了!

Full code here 完整代码在这里

 .square-container {
  width: 350px;
  position: absolute;
  top:50%;
  left:50%;
  box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
  -ms-transform: translateX(-50%) translateY(-50%);
  -webkit-transform: translate(-50%,-50%);
  transform: translate(-50%,-50%);

} }

So what I'm trying have is a grid of squares in a container with a box shadow affect. 所以我要尝试的是在一个带有盒子阴影效果的容器中放置一个正方形网格。

Check this JS Fiddle 检查这个JS小提琴

CSS 的CSS

 .trigger {
  float:left;
  }
 .panel {
  /*margin-top:47px;*/ 
 }

 .panel .front {
 /*position: absolute;*/
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM