我正在尝试使用CSS box shadow
为我的元素创建边框。
但是,我似乎无法让它发挥作用。
这是我的代码:
.vid_img{
display:inline-block;
width:25%;
vertical-align: top;
box-shadow: inset 0 0 0 -1px red;
}

<img src="https://static.pexels.com/photos/204611/pexels-photo-204611.jpeg" class="vid_img"><img src="https://static.pexels.com/photos/204611/pexels-photo-204611.jpeg" class="vid_img"><img src="https://static.pexels.com/photos/204611/pexels-photo-204611.jpeg" class="vid_img"><img src="https://static.pexels.com/photos/204611/pexels-photo-204611.jpeg" class="vid_img">
&#13;
答案 0 :(得分:1)
你可以这样做:
.vid_img {
display: inline-block;
width: 25%;
vertical-align: top;
box-shadow: 0 0 0 1px red;
}
<img src="https://static.pexels.com/photos/204611/pexels-photo-204611.jpeg" class="vid_img"><img src="https://static.pexels.com/photos/204611/pexels-photo-204611.jpeg" class="vid_img"><img src="https://static.pexels.com/photos/204611/pexels-photo-204611.jpeg" class="vid_img"><img src="https://static.pexels.com/photos/204611/pexels-photo-204611.jpeg" class="vid_img">