大众在IE9中无法正常工作 [英] VW not working correctly in IE9

查看:46
本文介绍了大众在IE9中无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IE9中,大众汽车对我来说显示异常.例如,10vw的值非常大,占视口宽度的10倍,而不是十分之一.将该值设置为0.1vw会产生接近预期的结果.奇怪的是,我在这个问题上几乎找不到任何东西,但是我会认为,如果这是一个真正的问题或不兼容,那么它将被广泛记录(并掌握).我在VM中使用IE9,所以我不知道这是否是问题.

VW units are displaying strangely for me in IE9. For instance, a value of 10vw is enormous, taking up ~10 times the viewport width instead of a tenth. Setting the value to 0.1vw yields results closer to what is expected. What is strange is that I can find almost nothing on this issue, but I would have thought that if this is a real issue or incompatibility it would have been widely documented (and griped about). I'm using IE9 in a VM, so I don't know if that's the issue or not.

这是我发现的jsfiddle,提供了一个简单的案例:

This is a jsfiddle I found that provides a simple case:

http://jsfiddle.net/dtvz5mty/

CSS:

#thisscales{
font-size:10vw;
width:40vw;
}

HTML:

<div id="thisscales">hai there!</div>

以前有人处理过吗?这是一个真实的问题吗?如果是这样,有什么好的解决方法?我想获取字体大小和文本元素的位置,以随视口缩放(我正在制作动画,并且元素的位置必须成比例).

Has anyone dealt with this before? Is this a real issue? If so, what is a good work around? I'd like to get font-sizes and the positions of text elements to scale with the viewport (I'm doing animations and the positioning of the elements must be proportional).

推荐答案

显然,这个问题不在HTML中包括:

So apparently not including this in the HTML was the problem:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

(╯°□°)╯︵┻━┻

(╯°□°)╯︵ ┻━┻

添加它很有魅力.我永远不会偷懒,不再赘述.

Adding it worked a charm. I will never be lazy and not include it again.

这篇关于大众在IE9中无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆