px v em
- Started
- Last post
- 7 Responses
- ukit
This has been discussed before, but I was wondering whether anyone actually uses ems for everything, ie not just fonts but all vertical and horizontal spacing. A lot of times I notice people use a mixture of the two, em for fonts and px for spacing/margin, but doesn't that sort of defeat the purpose?
- pt0
pt
- hawkwah0
Ems are great for structure sizing because they allow you to make fluid layouts where everything is relative. The main drawback is that images are usually fixed size and kinds mess up the fluidity.
- acescence0
it doesn't defeat the purpose, ems are used for fonts because it scales properly in browsers. I use ems for spacing like paragraph and line spacing, but pixels for left/right margins and box widths, etc..
- dbloc0
ex
- ukit0
That was sort of the approach I settled on, using em for vertical and % or px for horizontal, although I've never really heard it articulated before. You'd be surprised how many people mix the two for vertical spacing.
- welded0
Basically what acescence said.
