开发者

Removing scrollbar from <object> Embed

Cur开发者_如何学JAVArently I am using object to embed a adsense ad in a webpage

<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?


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

Example:

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


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

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


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

Example:

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


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.


Can be achieved with

display: flex;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜