size: 100% on the html element do?

This question already has an answer here:

  • CSS: 100% font size - 100% of what? 9 answers

  • There are many types of declaring the font-size as the same value for the browser.

  • font-size: 1em;

  • font-size: 100%;

  • font-size: 16px; // this is default

  • This way, you can get the default font-size. But note that 16 px will alter the font-size, however em and % will depend on the font-size used in the body tag.

    Fiddle: http://jsfiddle.net/afzaal_ahmad_zeeshan/5Wkus/

    So you'll see, em depends totally on the font-declared in body . Or you can say, it runs from child to parent. It keeps looking for the font-size change in the nearest parent. Which in most cases directs the code to the body element or the user agent default stylesheet.


    html上的字体大小100%等于浏览器的默认字体大小,可以是14px或16px。

    链接地址: http://www.djcxy.com/p/87480.html

    上一篇: 更改字体大小macvim?

    下一篇: 大小:100%的HTML元素呢?