Jump to content

should I use em only for text?


morningdew

Recommended Posts

Hi, it's me again. I hope it's okay to ask many questions :)

I am wondering: should I use em as a standard of measurement for other website elements as well in addition to font (e.g margin, padding, table)?

I understand that using em would make fonts resizable.

Should I use em all across the board for the sake of consistency? Or is it okay to use em for fonts and px for other elements?

Thank you in advance for your help.

Link to comment
Share on other sites

I understand that using em would make fonts resizable.

Should I use em all across the board for the sake of consistency? Or is it okay to use em for fonts and px for other elements?

To quickly define "em": (wikidepdia)

 

An em is a unit of measurement in the field of typography. This unit defines the proportion of the letter width and height with respect to the point size of the current font. Originally the unit was derived from the width of the capital "M" in a particular typeface. 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 point typeface is 16 points.

Since an em is a measurement specifically related to typography (the art of arranging type), it's intended primarily for use when sizing your text. I wouldn't use it to size other parts of the page -- that's just too messy. Use ems for text and pixels or percentages for your layout.

Link to comment
Share on other sites

i found this article very helpful as it kindof tests all the measurements that we can use for typography - but, the book "principles of beautiful web design" explain very well how to use the em (as i thing you need something like:

 

body{
font-size: 60%; // I THINK IS 60%;
}

 

in order for your em's to be more managable - but ye i strongly recomend you read that book from sitepoint.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...