Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html IE显示dom元素转换后的水平滚动条_Html_Css_Internet Explorer_Horizontal Scrolling - Fatal编程技术网

Html IE显示dom元素转换后的水平滚动条

Html IE显示dom元素转换后的水平滚动条,html,css,internet-explorer,horizontal-scrolling,Html,Css,Internet Explorer,Horizontal Scrolling,我在我的网站的不同地方使用了以下css: 在internet explorer中运行时,您会注意到一个水平滚动条,它似乎忽略了页面总宽度的转换。有一个简单的解决方案: 我没有将元素向左发送50%(向右)并使用变换将其向左发送,而是执行完全相反的操作。 直到现在我才考虑过,但是如果你把一个元素放在最左边,它不会影响页面宽度或滚动条 奇怪的是,如果您使用top 50%和translate(0px,-50%)进行垂直居中,它似乎不会影响垂直滚动条 以这种方式使用变换时,似乎只有Internet E

我在我的网站的不同地方使用了以下css:


在internet explorer中运行时,您会注意到一个水平滚动条,它似乎忽略了页面总宽度的转换。

有一个简单的解决方案:

我没有将元素向左发送50%(向右)并使用变换将其向左发送,而是执行完全相反的操作。 直到现在我才考虑过,但是如果你把一个元素放在最左边,它不会影响页面宽度或滚动条

奇怪的是,如果您使用top 50%和translate(0px,-50%)进行垂直居中,它似乎不会影响垂直滚动条


以这种方式使用变换时,似乎只有Internet Explorer不会重新计算水平边界。真烦人。IE糟透了。

我在IE团队工作,最近对这种行为提出了一个bug。此外,通过这个bug,试图了解这个bug的影响。您是否有受此影响的活动站点?如果是这样的话,它将帮助我们理解修复的紧迫性。不幸的是,它还没有启动,但是JSFIDLE清楚地演示了它。实际上,我也遇到了垂直居中的问题,这正是我来到这里的原因——尽管相同的解决方案似乎也在那里起作用-
.a {
    position:absolute;
    background:red;
    width:600px;
    height:100px;
    left:50%;
    transform: translate(-50%);
}
.a {
    position:absolute;
    background:red;
    width:600px;
    height:100px;
    right:50%;
    transform: translate(50%);
}