|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Margin and Padding Units
Hello,
I always use EM for text size, letter spacing and line heights. For DIV widths I usually use PIXELS if fixed width web site and PERCENT if fluid layout web site. I think in both cases I am doing the right thing ... I think. But what unit should I use for padding and margin? EM? PIXEL? Thanks, Miguel |
|
#2
|
||||
|
||||
|
Good question.
I'd say it depends on the situation. I use both on different occasions.So you haven't considered using elastic layouts? Fixed vs Liquid vs Elastic Elastic Design About fluid and fixed width layouts Fixed or fluid width? Elastic! Specify a maximum width for em-based layouts Actually Unitless Line Heights have an advantage to using EMs for that.
__________________
Spreading knowledge, one newbie at a time. Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions IE7: the generation 7 browser new in a world of generation 8 browsers. Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around. |
|
#3
|
|||
|
|||
|
Hi
For margins, padding it depends what you want I guess. The reason for em, as I'm sure you know, is to acomadate different font sizes of users. margins and padding contain no data so it really doesn't matter, I don't think. If you want it to expand with font size increases, use em, if not use px. And remember too that if you use px for div's that contain text they won't expand when font sizes are increased. Best thing to do is view your code in different resolutions with different font sizes to see how well it copes. |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Margin and Padding Units |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|