IE8中css字体大小自适应设置

html-css015

IE8中css字体大小自适应设置,第1张

要通过代码设置,C语言<!DOCTYPE HTML>

<html>

<head>

<meta charset="UTF-8">

<title>Demo</title> <style type="text/css">

#box { font-size: 4vw}</style></head><body> <div id="box">

我是靖鸣君 我是靖鸣君 我是靖鸣君</div></body></html>

但是该方案存在一个bug,上面的代码,当浏览器窗口变化的时候,box中的文字并没有按照应有的比例变化,但是css3标准中是这么说的:

When the height or width of the viewport is changed, they are scaled accordingly.

尊敬的用户,您好!很高兴为您答疑。

以color属性为例,

color:#ff0000/*一般属性ff*/

color:#ff0000\9/*仅针对ie8有效*/

*color:#ff0000/*仅针对ie7有效*/

_color:#ff0000/*仅针对ie6有效*/

希望我的回答对您有所帮助,如有疑问,欢迎继续咨询我们。

针对firefox ie6 ie7 ie8的css样式hack 以前我们大部分都是用!important来hack,对于ie6和firefox测试可以正常显示,但是ie7以上对!important可以正确解释