Html 从 <object> 嵌入中删除滚动条

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4834899/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 06:24:11  来源:igfitidea点击:

Removing scrollbar from <object> Embed

htmlcss

提问by BlindingDawn

Currently I am using object to embed a adsense ad in a webpage

目前我正在使用对象在网页中嵌入 Adsense 广告

<object data="frontpage_blogrool_center_top_728x90" type="text/html" width="732" height="95" ></object>

I made the object larger than the original so that the scrollbar will not appear on the webpage but it still appears in IE8. Is there anyway to remove it?

我使对象比原来的大,这样滚动条就不会出现在网页上,但它仍然出现在 IE8 中。有没有办法删除它?

采纳答案by Tim Cooper

Add style="overflow:hidden; width: 732px; height: 95px"to the element:

添加style="overflow:hidden; width: 732px; height: 95px"到元素:

<object data="frontpage_blogrool_center_top_728x90" 
        type="text/html" width="732" height="95"
        style="overflow:hidden; width: 732px; height: 95px"></object>

回答by You Garmendia

You must add to the parentof the <object />element's css, overflow: hidden;

您必须添加到的的<object />元素的CSS,overflow: hidden;

Example:

例子:

<body style="overflow:hidden;">
    <object ...>
    </object>
</body>

回答by Dirk Jan

Give the <object>a min-height: 101%or more!

<object>一个min-height: 101%或更多!

Example:

例子:

object {
  min-width: 100%;
  min-height: 101%; //not 100% but more than 101
}

回答by Joneskind

I solved my similar problem (embedding a complex SVG with all his JS and style stuff) just by adding a position: fixed to the body tag of the HTML content I wanted to embed. Though I can use a width:100% to keep my dimensions everywhere.

我通过添加一个 position: fixed 到我想要嵌入的 HTML 内容的 body 标签解决了我的类似问题(将复杂的 SVG 与他的所有 JS 和样式内容嵌入)。虽然我可以使用 width:100% 来保持我的尺寸无处不在。