css - IFrame 未居中对齐

标签 css html razor

我正在使用以下 outlook 代码,它在我的网站中嵌入了 Outlook 日历,但默认情况下它是左对齐的。你能告诉我让它与屏幕居中对齐吗?

谢谢

我使用的代码是

<style unselectable="on">
#wrap {
width:1000px;
height:900px;
padding:0;
position:relative;
left:0px;
top:0px;
overflow:hidden;
}
#frame {
width:1000px;
height:900px;
position:relative;
left:0px;
top:0px;
}
#frame {
-ms-zoom:0.7;
}
</style>
<div id="wrap" unselectable="on">
    <iframe id="frame" src="[paste in here the link that outlook.com provides for you ... in between the quotes and without the brackets]"></iframe>
</div>

最佳答案

对于居中对齐,将 margin:0 auto 设置为其父级(如果父级的宽度以 px 为单位)或 iframe。

#wrap {
width:1000px;
height:900px;
padding:0;
position:relative;
left:0px;
top:0px;
overflow:hidden;
margin:0 auto;
}

关于css - IFrame 未居中对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30192213/

相关文章:

html - 如何仅在大型设备中添加表格样式

asp.net-core - 在 MVC View /Razor 页面中使用 RenderComponentAsync (Blazor WebAssembly)

asp.net-mvc - 在回发 ASP.NET MVC 上获取复选框值

html - 让页脚粘在页面底部

javascript - 即使使用 oncomplete 后,IndexedDB DOM IDBDatabase 异常 11

css - Eclipse 中 Javadoc 的自定义样式

html - 对齐一个盒子,在底部而不是顶部

jquery - 动态地将项目添加到集合中

javascript - 如何使用 Jquery/css 更改另一个 td 中 td 的宽度?

javascript - 如何将按钮更改为可单击的文本,以执行与按钮相同的操作