Using fractional em's in CSS's font-size property

后端 未结 2 702
小蘑菇
小蘑菇 2020-12-15 23:27

Say, I have the following CSS rule defined:

.className {
font-size:0.89em;
}

My question is, how \"deep\" into fractions can I go while spe

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 00:14

    It should be kept in mind though, that fractional em values, like all floating point numbers, are susceptible to rounding error.

    I found that out while setting my media query boundaries, where one max-width was 0.00001em away from another min-width, and it was rounded up and both queries were activated. After changing the difference to 0.001em the queries worked as expected, exclusively.

提交回复
热议问题