0

#mainContent p {
    font-family: Georgia, serif;
    font-size: 0.9em;
    line-height: 1.4em;
    color: #000;
    margin: 1ex 0;
}

I've met this code in a project. When I got to check this on devtool of Chrome I found that margin: 1ex 0 gives the following, margin-top: 6.9328px margin-bottom: 6.9328px margin-right: 0 margin-left: 0

My question is, what equation was used to get 1ex to equal 6.9328px?

MYB
  • 69
  • 8
  • just googled and got this information https://www.w3.org/Style/Examples/007/units.en.html – Suresh Ponnukalai Mar 30 '18 at 05:34
  • The information is contained in the font, that is, it's stored somewhere in the font file, and it's different for each font. So there is no equation. – Mr Lister Mar 30 '18 at 06:10
  • There is a little trick called [font-size-adjust](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size-adjust) which you may be able to make use of - basically it allows you to set your own `ex` size. But beware that it currently does not work in IE or Edge. – Mr Lister Mar 30 '18 at 06:15

0 Answers0