不完全,但你的問題可以通過其解決。
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