jquery - iframe 不会以移动设备为中心?

标签 jquery html css mobile iframe

我的 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/

相关文章:

javascript - 按距离优化路线

javascript - 未捕获的类型错误 : Cannot read property 'focus' of undefined

html - 递归 Angular 搞乱CSS

javascript - 使用 JavaScript 访问 CSS3 translate 转换偏移量

jquery - 每次我将鼠标悬停在一个按钮上时,另一个按钮就会向右移动

php - Html5 css3 Jquery 页面转换

javascript - 改变样式不透明度的 jQuery/JavaScript 函数

Jquery 循环 - IE8 问题

html - Bootstrap 3 - 网格未正确对齐

javascript - 在某些情况下我应该如何处理从 Controller 调用模态窗口