HTML – 如何在中间css中制作阴影

前端之家收集整理的这篇文章主要介绍了HTML – 如何在中间css中制作阴影前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用影子盒,但它使所有的容器都被阴影包裹起来,我怎样才能在中间制作一个阴影,如上图所示?

解决方法

CSS drop-shadows without images by Nicolas Gallagher

FIDDLE

<div class="drop-shadow curved curved-hz-2">
    <p>Horizontal curves</p>
</div>

.drop-shadow {
   position: relative;
   float: left;
   width: 40%;
   padding: 1em;
   margin: 2em 10px 4em;
   background: #FFF;
   -webkit-Box-shadow: 0 1px 4px rgba(0,0.3),0 0 40px rgba(0,0.1) inset;
   -moz-Box-shadow: 0 1px 4px rgba(0,0.1) inset;
   Box-shadow: 0 1px 4px rgba(0,0.1) inset;
}
.drop-shadow:before,.drop-shadow:after {
    content: "";
    position: absolute;
    z-index: -2;
}
.curved-hz-2:before {
    top: 0;
    bottom: 0;
    left: 10px;
    right: 10px;
    -moz-border-radius: 100px / 10px;
    border-radius: 100px / 10px;
}
.curved:before {
    top: 10px;
    bottom: 10px;
    left: 0;
    right: 50%;
    -webkit-Box-shadow: 0 0 15px rgba(0,0.6);
    -moz-Box-shadow: 0 0 15px rgba(0,0.6);
    Box-shadow: 0 0 15px rgba(0,0.6);
    -moz-border-radius: 10px / 100px;
    border-radius: 10px / 100px;
}
原文链接:https://www.f2er.com/html/226508.html

猜你在找的HTML相关文章