img 标签设置

1、设置图片缩放的比例

.demo img{  
-webkit-transform: scale(1) rotate(0) translate3d(0,0,0); //设置缩放scale的大小  
transform: scale(0.5) rotate(0) translate3d(0,0,0);
自定义背景图片,改变背景图片的大小
background-size:100% 120px;
}
2、设置图片在底部,且不随input的聚焦而改变位置
.ulist {
width: 100%;
position:relative;
z-index: 3;
background: white;
}
.imgBottom {
width: 100%;
height: 110px;
position:absolute;
bottom:0;
left:0;
z-index: 1;
}
3、取消长按图片出现保存或者图片被打开
img{
pointer-events: none;
}
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

猜你喜欢

转载自blog.csdn.net/yangyanli0309/article/details/80620312
今日推荐