Skip to:

Opened 10 years ago

Closed 10 years ago

#740 closed defect (worksforme)

ex vs em for unit of measure

Reported by: chrishajer Owned by: mdawaffe
Milestone: 0.9 Priority: normal
Severity: normal Version:
Component: Front-end Keywords:

Description (last modified by mdawaffe)

Should this:

332 	#forumlist tr td div.nest {
333 	        padding-left: 2.5ex;


actually be this:

332 	#forumlist tr td div.nest {
333 	        padding-left: 2.5em;
334 	}

Change History (8)

#1 @mdawaffe
10 years ago

  • Milestone set to 0.8.3 & XML-RPC
  • Owner set to mdawaffe
  • Status changed from new to assigned

After reading up a bit on it, I agree that em is probably a better unit than ex. However, ex is still a valid CSS length unit and should not be the cause of this problem (in the forum topic you cite, other lines are getting indented with ex, after all).

There was an earlier bug (can't find a reference) where the indentation would be wrong if the subforum had a lower forum_id than it's parent. This looks to be a similar bug.

I've just reproduced the problem and am looking for a solution now.

#2 @mdawaffe
10 years ago

  • Description modified (diff)
  • Milestone changed from 0.8.3 & XML-RPC to 0.8.4 & WP-Taxonomy
  • Summary changed from Line 333 of style.css: ex vs em for padding-left unit of measure to ex vs em for unit of measure

Moving the actual bug over to #741. This ticket can discuss the stylistic choice of ex v. em.

#3 follow-up: @fel64
10 years ago

W3 doesn't seem to prefer one over the other:

However, an 'ex' is defined even for fonts that don't contain an "x".

That, though, shows that the x is a bit arbitrary for non-roman fonts. Especially in those cases does the em value make more sense.

#4 in reply to: ↑ 3 ; follow-up: @sambauers
10 years ago

Replying to fel64:

That, though, shows that the x is a bit arbitrary for non-roman fonts.

Can't the same be said for "em"?

I kind of think we should be using one or the other, but not both.

#5 @sambauers
10 years ago

It's not really a stylistic choice (or was that a bad CSS joke). I guess we need to ask questions about which units behave themselves properly in different browsers.

#6 in reply to: ↑ 4 @fel64
10 years ago

Replying to sambauers:

Can't the same be said for "em"?


An em is a unit of measurement in the field of typography, equal to the pt size of the current font. This unit is not defined in terms of any specific typeface, and thus is the same for all fonts at a given point size.[1] So, 1 em in a 16 pt typeface is 16 points.

#7 @sambauers
10 years ago

Well there you go. I subscribed to the (incorrect) theory that an em was the width of an uppercase "M". Thanks for that.

#8 @sambauers
10 years ago

  • Resolution set to worksforme
  • Status changed from assigned to closed

So we are sticking with EMs and only EMs then. This can be re-opened if anyone wants to make any more points.

Note: See TracTickets for help on using tickets.