一。图片在div里面
.top-imagebox{//div
width: 60%;
height: 40%;
overflow: hidden;
position: relative;
img{
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
max-width: 100%;
margin: auto;
}
}
二。使用了背景图片
.top-imagebox{
background-image:'....',
background-size:'cover',
background-repeat:'no-repeat',
background-position:'center'
}