此页面上“获取门票”按钮下的图像中出现问题 http://www.luaumakaiwa.com/Terms/tabid/71/Default.aspx 当您使用移动设备查看页面时,图像不会居中显示,而是左对齐。
代码是
@media(max-width:717px){
.top-img-cont{
display: block;
width: 100%;
height: 207px;
overflow: hidden;
}
}
我尝试添加“margin: 0 auto;”对 top-img-cont 进行分类,但它仍然不起作用。
最佳答案
你需要添加:
.top-img-cont img {
display:block;
margin:0 auto;
width: 200px;
height: auto;
}
关于css - 图像不会在移动设备上居中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39734747/