有没有办法使用CSS将文本大小设置为窗口大小的百分比?

Gre*_*reg 4 html css fonts

有没有办法将文本大小设置为浏览器窗口的百分比?例如:

h1
{
    height: 15%;
    /* in my ideal world this would be 15% of the window 
       (or parent) size rather than inherited font-size */
}
Run Code Online (Sandbox Code Playgroud)

YMM*_*MMD 5

在CSS3中:

h1{
   font-size: 15vw; // relative to the viewport's width
   font-size: 15vh; // relative to the viewport's height
   font-size: 15vm; // relative to the ratio width/height of the viewport
}
Run Code Online (Sandbox Code Playgroud)

但是,这当然不适用于所有浏览器.

请看这里:http://www.w3.org/TR/css3-values/#viewport-relative-lengths