Using relative instead of fixed size in CSS

后端 未结 2 1866
旧时难觅i
旧时难觅i 2021-01-26 17:33

I want to use relative size instead of fixed size. I want to use em.

My CSS is:

body{
     font:10px;
}

#wrap {
   font:1.2em;
}

#wrap ul li {
   paddi         


        
2条回答
  •  伪装坚强ぢ
    2021-01-26 18:08

    the font size of #wrap ul li is 10px*1.2em*2em, thus padding-left:24px;

    it always takes the font size of the parent element (in your case #wrap)

提交回复
热议问题