Does this match the font size standardly: 62.5% / 1.2em in CSS?

I noticed that some stylesheets have something like this:

body { font-size: 62.5%/1.2em; } 

I received a "unexpected token /" warning when I wrote this on NetBeans. And if I changed the value of EM, let's say

 body { font-size: 62.5%/1em; } 

The calculated font size remains 16px.

My question is: is it compatible with something like that? And how to calculate the actual font size?

+4
source share
1 answer

In CSS2, the font-size property does not allow x/y form values.

What you use is the short property's font property , which allows x/y to be font-size: x; line-height: y; font-size: x; line-height: y; . Therefore either use

 body { font: 62.5%/1.2em sans-serif; } /* ^^^^^^^^^^ the font-family is needed. */ 

or

 body { font-size: 62.5%; line-height: 1.2em; } 
+8
source

Source: https://habr.com/ru/post/1307475/


All Articles