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

html-css09

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.

<!--[if IE 8]><link rel="stylesheet" type="text/css" href="特定的CSS文件URL" /><![endif]-->

以上CSS只有在IE8下才会加载,其他版本的浏览器浏览器不会加载

然后你就写你的特定css即可