我的 iFrame 未在移动设备上居中。我必须将宽度定义为 1250px,否则它只会在桌面上显示一小部分 iFrame。我真的需要黑边在移动设备上远离屏幕...
http://www.howlatthemoon.com/birthday-parties-chicago
(我必须使用 iFrame,因为我的 CMS 太过时了,它无法使用此代码。我只想隐藏边缘的黑色渐变,但 CMS 不响应媒体查询)
iframe, object, embed {
max-width: 100%;
}
#midslide {
clear:right;
margin-top: -47px;
position: relative;
overflow: auto;
margin-left: auto !important;
margin-right: auto !important;
width:1250px;
height:338px;
}
.center{
margin-left: auto;
margin-right: auto;
display: block;
width: 100%;
}
<iframe scrolling="no" frameborder="0" id="midslide" align="middle" src="http://www.howlatthemoon.com/images/howl/landing/birthday-parties/slider2.html"></iframe>
感谢任何能提供帮助的人!
最佳答案
试试这个
#midslide {
clear: right;
height: 400px;
margin-left: auto !important;
margin-right: auto !important;
margin-top: -47px;
overflow: auto;
position: relative;
width: 100%;
}
关于jquery - iframe 不会以移动设备为中心?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20040136/