美化WordPress插入到文章中的相册


.gallery{
margin:-1%!important;
}
.gallery .gallery-item {
padding:1%;
/* width:14.66666%!important; */
margin: 0 !important;
overflow:hidden;
position:relative;
}
.gallery-columns-3 .gallery-item{
width:33.3333333%!important;
}
.gallery .gallery-item dt:before {
content: "";
display: block;
padding-top: 100%;
}
.gallery .gallery-item dt {
position: relative;
box-shadow:0 0 0 1px rgba(0,0,0,.1) inset;
background: #eee;
cursor: pointer;
overflow: hidden;
}
.gallery .gallery-item img{
position:absolute;
top: 0;
left: 0;
height:100%;
width:100%;
object-fit:cover;
border:0!important;
}

新属性兼容性
PC:兼容绝大部分现代主流浏览器(webkit内核、firefox),不支持IE
Mobile:Safari、Android4.4.4+(国内ROM上Android5.x兼容不同)

代码来自:https://biji.io/2016/4657.html

Leave a Reply

Your email address will not be published. Required fields are marked *

返回主页看更多
狠狠的抽打博主 支付宝 扫一扫