The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

If your font size is going to be set in percentages, set your line-height to a percentage as well for consistency. If a user bumps their text size up to something past 17px tall, your lines will run into each other.

Yes as Vinnie says if the line-height is fixed in pixels and the font is percent then the font will grow but the line-height will stay the same and the font may grow out of the line.

If you use percent or ems for line-height then they stay proportional to each other as the text is resized.

If you have the font-size int the body set to 12px and your p tag set to 75% then that will be 9px high. So you can work out from there how much bigger 17px line height would need to be (about 1.9ems if my maths is correct )

If you have the font-size int the body set to 12px and your p tag set to 75% then that will be 9px high. So you can work out from there how much bigger 17px line height would need to be (about 1.9ems if my maths is correct )

and also.. one last thing... when the text appears in the context of a form, such as in the above code. When setting the size of the text to something quite big (using my browser) I realized that the input fields and the text don't line up nicely... why is that? can I avoid that?

There's no real way to directly translate pixels to ems. Ems are based on the user's default text setting in their browser. Most browsers' default size is 14px unless the user decides to change it, but some browsers have 16px as the default. If you need to use pixels, then use pixels. Otherwise, if you have more flexibility in your layout use percentages or ems.

So using % or ems is quite the same is that it?
In this case I think I will feel more comfortable with ems...

Use what you're comfortable with. They pretty much do the same thing.

Originally Posted by duuudie

what about the 'resizing text/forms' issue?

What do you mean? A user will resize text if they need to (I tend to do it on small-text sites myself; my eyesight isn't so great if I don't have my contact lenses in). Make sure your layout can accommodate at least a few different text sizes if possible. .