【问题标题】:How to avoid the scrollbar in IE?如何避免 IE 中的滚动条?
【发布时间】:2015-04-16 14:31:33
【问题描述】:

我有一个宽度为 533px 的 div,在 div 内我有相同宽度的 svg 元素来容纳一些 rect 元素。

<div style="left: 47px; top: 479px; width: 533px; height: 56px; position:  absolute;>

<svg style=" width: 533px; height: 56px;>
 .... 
 // Some rect Element inside the svg
</svg>

<div>

矩形的宽度高于 svg 元素,所以我使用剪贴路径裁剪了矩形。现在 svg 外的 rect 药水不可见。但是水平滚动条会启用到窗口中的矩形宽度。这仅在 IE 中发生。在其他浏览器中它工作正常。

如何解决这个问题?

提前致谢

【问题讨论】:

  • document.getElementById("myDiv").style.overflow = "hidden";

标签: javascript css svg


【解决方案1】:

这是你的浏览器兼容性问题,你必须更新你的浏览器或者你可以使用

<style>overflow:hidden;</style>

将此代码写入您的标题或主 css.. 希望它会工作

【讨论】:

    猜你喜欢
    • 2018-03-26
    • 2017-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-05
    • 2023-01-19
    • 1970-01-01
    • 2016-05-03
    相关资源
    最近更新 更多