不完全,但你的问题可以通过其解决。
HTML
<div class="shadow">
<div class="img">
<img src="http://placehold.it/250x300" alt="" />
</div>
</div>
CSS
*{
box-sizing: border-box;
}
.shadow {
width: 250px;
height: 300px;
position: relative;
margin: auto;
}
.img {
padding: 15px;
background: #fff;
}
img {
display: block;
max-width: 100%;
height: auto;
}
.shadow {
position: relative;
}
.shadow:after,
.shadow:before,
.img:after,
.img:before{
content: "";
width: 50px;
height: 50px;
box-shadow: 0px 0px 26px rgba(0, 0, 0, 0.6);
position: absolute;
z-index: -1;
}
.shadow:before,
.shadow:after{
top: 0;
}
.img:before, .img:after {
bottom: 6px;
}
.shadow:before{
left: 0;
}
.shadow:after {
right: 0;
}
.img:before {
left: 0;
}
.img:after {
right: 0;
}
见Fiddle
看起来你必须使用'border-image'来实现这一点。祝你好运! – John
您可以将图片保存为带有该阴影的PNG或使用html,您必须将4个方格绝对放置在图像角落,并为它们应用方块阴影 – sTx
不知道在哪里,但我看到过去用过的相同的东西,一个svg。我认为它被用作包含该照片的div的背景图像。 – enhzflep