![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
dorayme wrote: There is a view that ex units should be used instead of em units. I have recently found that using ex instead of em fixed some cross-browser issues. See: http://kb.mozillazine.org/Em_units_versus_ex_units It is all precious nonsense. It does not matter about small variations and if it concerns anyone, they are obsessing about the wrong things. What I was "obsessing about", which I solved by switching a particular dimension from em to ex units, was a problem with a CSS-based dropdown menu: with Opera, when the user pointed to a menu item, then moved the cursor down to the associated dropdown menu, the dropdown menu sometimes disappeared. IMO such a problem in a website is not unimportant. |
#12
| |||
| |||
|
|
C A Upsdell wrote: I was more interested in fixing the problem than in determining exactly why the switch to ex units worked, but my suspicion is this: In the CSS used to implement the dropdown menu, a mixture of em and ex units was used, Stop right there. There you have the problem, fix it. Don't assume that em and ex units have some specific relationship to each other. They don't. We know that some browsers use ex = 0.5em whereas some browsers correctly treat ex as the x-height. This can make a considerable difference. This is far more important than some assumed bugs in rounding. |
#13
| |||
| |||
|
|
In article <hbgrdb$ksa$1 (AT) news (DOT) eternal-september.org>, C A Upsdell <cupsdell (AT) nospam (DOT) not> wrote: dorayme wrote: There is a view that ex units should be used instead of em units. I have recently found that using ex instead of em fixed some cross-browser issues. See: http://kb.mozillazine.org/Em_units_versus_ex_units It is all precious nonsense. It does not matter about small variations and if it concerns anyone, they are obsessing about the wrong things. What I was "obsessing about", which I solved by switching a particular dimension from em to ex units, was a problem with a CSS-based dropdown menu: with Opera, when the user pointed to a menu item, then moved the cursor down to the associated dropdown menu, the dropdown menu sometimes disappeared. IMO such a problem in a website is not unimportant. I agree that in the area of dropdown menus, one sometimes needs all the help one can get, they can be tricky beasts and it cannot hurt to keep in mind your thought to use ex if one runs into cross browser problems. But without a specific case, it is hard to know in advance. One of the things you tend to run into in dropdown menus is wrap and height problems and using the ex might simply be a more reliable way just for these problems. I have no idea how it might affect or generate other problems though? |
#14
| |||
| |||
|
|
dorayme wrote: There is a view that ex units should be used instead of em units. *I have recently found that using ex instead of em fixed some cross-browser issues. *See: * * *http://kb.mozillazine.org/Em_units_versus_ex_units |
|
It is all precious nonsense. It does not matter about small variations and if it concerns anyone, they are obsessing about the wrong things. What I was "obsessing about", which I solved by switching a particular dimension from em to ex units, was a problem with a CSS-based dropdown menu: *with Opera, when the user pointed to a menu item, then moved the cursor down to the associated dropdown menu, the dropdown menu sometimes disappeared. *IMO such a problem in a website is not unimportant. I was more interested in fixing the problem than in determining exactly why the switch to ex units worked, but my suspicion is this: *In the CSS used to implement the dropdown menu, a mixture of em and ex units was used, and Opera likely handles the relationship between em and ex units differently from other browsers, which sometimes resulted in a small vertical gap between the menu item and its associated dropdown menu. A small gap would normally not be important, but it was important here because, when the cursor fell into the gap, the cursor no longer :hovered over the menu item or dropdown menu, and so the dropdown menu naturally disappeared. *Switching completely to ex units renders irrelevant any difference in the relationship between em and ex units. |
#15
| |||
| |||
|
|
On 19 oct, 00:54, C A Upsdell <cupsd... (AT) nospam (DOT) not> wrote: dorayme wrote: There is a view that ex units should be used instead of em units. I have recently found that using ex instead of em fixed some cross-browser issues. See: http://kb.mozillazine.org/Em_units_versus_ex_units { At "normal" font sizes (the defaults on Windows systems, and possibly Linux and others), 1 em is 10.06667 pixels, and 1 ex is 6 pixels. } That's not true. In IE (all versions), the "normal" default font size is 16px. And if 1em is 16px, then 1ex exact font-size expressed in pixels depends on the font family in use: |
#16
| |||
| |||
|
|
GTalbot wrote: On 19 oct, 00:54, C A Upsdell <cupsd... (AT) nospam (DOT) not> wrote: dorayme wrote: There is a view that ex units should be used instead of em units. I have recently found that using ex instead of em fixed some cross-browser issues. See: http://kb.mozillazine.org/Em_units_versus_ex_units { At "normal" font sizes (the defaults on Windows systems, and possibly Linux and others), 1 em is 10.06667 pixels, and 1 ex is 6 pixels. } That's not true. In IE (all versions), the "normal" default font size is 16px. And if 1em is 16px, then 1ex exact font-size expressed in pixels depends on the font family in use: Confirmed. |
#17
| |||
| |||
|
|
That's not true. In IE (all versions), the "normal" default font size is 16px. |
#18
| |||
| |||
|
|
GTalbot wrote: On 19 oct, 00:54, C A Upsdell <cupsd... (AT) nospam (DOT) not> wrote: dorayme wrote: There is a view that ex units should be used instead of em units. *I have recently found that using ex instead of em fixed some cross-browser issues. *See: * * *http://kb.mozillazine.org/Em_units_versus_ex_units { At "normal" font sizes (the defaults on Windows systems, and possibly Linux and others), 1 em is 10.06667 pixels, and 1 ex is 6 pixels. } That's not true. In IE (all versions), the "normal" default font size is 16px. And if 1em is 16px, then 1ex exact font-size expressed in pixels depends on the font family in use: Confirmed. *I created a test page earlier today which computes em and ex values, and I found these interesting results: With FF 3.5 running on Windows XP, when an em is 16px, the ex sizes for Arial, Tahoma, Times New Roman, and Verdana are: * * *9px 9px 7px 9px When the size is reduced using font-size:small, the em size is 13px, and the ex sizes are: * * *7px 7px 6px 7px With IE 7, also running on Windows XP, when an em is 16px, the ex sizes are: * * *8px 8px 8px 8px When the size is reduced using font-size:small, the em size is 13.33px, and the ex sizes are: * * *6.67px 6.67px 6.67px 6.67px With Opera 10, also running on Windows XP, when an em is 16px, the ex sizes are: * * *8px 8px 8px 8px When the size is reduced using font-size:small, the em size is 13px, and the ex sizes are: * * *6.5px 6.5px 6.5px 6.5px Clearly FF, IE, and Opera use different methods of calculating ex values, and different methods of calculating the small font size. *I don't like to generalize based on only 4 fonts on one platform, but it would *appear* that: 1. *IE and Opera set the ex value to half the em value. 2. *FF sets the ex value to different fractions of the em value, depending on the font (which is probably more correct). 3. *IE makes no attempt to make the ex value an integer, nor does it make any attempt to make the em value for small fonts an integer. 4. *FF and Opera *may* be trying to set the em value for small fonts and integer, though this is scarcely certain.- Hide quoted text - - Show quoted text - |
#19
| |||
| |||
|
|
GTalbot wrote: On 19 oct, 00:54, C A Upsdell <cupsd... (AT) nospam (DOT) not> wrote: dorayme wrote: There is a view that ex units should be used instead of em units. *I have recently found that using ex instead of em fixed some cross-browser issues. *See: * * *http://kb.mozillazine.org/Em_units_versus_ex_units { At "normal" font sizes (the defaults on Windows systems, and possibly Linux and others), 1 em is 10.06667 pixels, and 1 ex is 6 pixels. } That's not true. In IE (all versions), the "normal" default font size is 16px. And if 1em is 16px, then 1ex exact font-size expressed in pixels depends on the font family in use: Confirmed. *I created a test page earlier today which computes em and ex values, and I found these interesting results: With FF 3.5 running on Windows XP, when an em is 16px, the ex sizes for Arial, Tahoma, Times New Roman, and Verdana are: * * *9px 9px 7px 9px When the size is reduced using font-size:small, the em size is 13px, and the ex sizes are: * * *7px 7px 6px 7px With IE 7, also running on Windows XP, when an em is 16px, the ex sizes are: * * *8px 8px 8px 8px |
|
When the size is reduced using font-size:small, the em size is 13.33px, and the ex sizes are: * * *6.67px 6.67px 6.67px 6.67px With Opera 10, also running on Windows XP, when an em is 16px, the ex sizes are: * * *8px 8px 8px 8px When the size is reduced using font-size:small, the em size is 13px, and the ex sizes are: * * *6.5px 6.5px 6.5px 6.5px Clearly FF, IE, and Opera use different methods of calculating ex values, and different methods of calculating the small font size. *I don't like to generalize based on only 4 fonts on one platform, but it would *appear* that: 1. *IE and Opera set the ex value to half the em value. |
|
2. *FF sets the ex value to different fractions of the em value, depending on the font (which is probably more correct). 3. *IE makes no attempt to make the ex value an integer, nor does it make any attempt to make the em value for small fonts an integer. |
#20
| |||
| |||
|
|
On 22 oct, 19:09, C A Upsdell <cupsd... (AT) nospam (DOT) not> wrote: GTalbot wrote: On 19 oct, 00:54, C A Upsdell <cupsd... (AT) nospam (DOT) not> wrote: dorayme wrote: There is a view that ex units should be used instead of em units. I have recently found that using ex instead of em fixed some cross-browser issues. See: http://kb.mozillazine.org/Em_units_versus_ex_units { At "normal" font sizes (the defaults on Windows systems, and possibly Linux and others), 1 em is 10.06667 pixels, and 1 ex is 6 pixels. } That's not true. In IE (all versions), the "normal" default font size is 16px. And if 1em is 16px, then 1ex exact font-size expressed in pixels depends on the font family in use: Confirmed. I created a test page earlier today which computes em and ex values, and I found these interesting results: With FF 3.5 running on Windows XP, when an em is 16px, the ex sizes for Arial, Tahoma, Times New Roman, and Verdana are: 9px 9px 7px 9px When the size is reduced using font-size:small, the em size is 13px, and the ex sizes are: 7px 7px 6px 7px With IE 7, also running on Windows XP, when an em is 16px, the ex sizes are: 8px 8px 8px 8px Charles, It may not be reliable to test IE 7 and then conclude or generalize. IE 7 is buggy with the ex unit. |
![]() |
| Thread Tools | |
| Display Modes | |
| |