Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your example, if you look at computed styling, your buttons are actually coming up with a <code>font-size</code> of <code>13px</code>. Even though your <code>html, body</code> rule should be making that <code>16px</code> (100%,) it isn't. It's definitely showing up at <code>13px</code>. And of course, since the <code>.em</code> one is being calculated based on that <code>font-size</code>, the final pixel size is not what you're expecting.</p> <p>Forcing the <code>font-size</code> for the buttons will make them display the same:</p> <p><a href="http://jsfiddle.net/yzvS8/3/" rel="nofollow">http://jsfiddle.net/yzvS8/3/</a></p> <pre><code>html, body { width: 100%; height: 100%; margin: 0; padding: 0; font-size: 16px; } .em { position: relative; width: 9.375em; /* 150px */ height: 3.125em; /* 50px */ background: #18a397; text-align: center; margin: 1em; font-size: inherit; } .px { position: relative; width: 150px; /* 9.375em */ height: 50px; /* 3.125em */ background: #18a397; text-align: center; margin: 16px; font-size: inherit; } </code></pre> <p>It's interesting to note that under "Styles" there is no mention of the <code>font-size</code> being set differently by the browser in Chrome, but in Firefox you can see in Computed Styling the font-size is saying <code>13.3333px</code> and it's coming from the browser defaults forms.css stylesheet saying <code>button { font: -moz-button; }</code>.</p> <p>So, some browser default styling that doesn't clearly present itself, is affecting the buttons.</p> <p><strong>EDIT:</strong> using <code>font-size: inherit;</code> to get buttons to style as expected, thanks to @cen</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload