468,537 Members | 1,826 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

padding and margin 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
Jun 27 '08 #1
5 3024
In article
<19**********************************@b64g2000hsa. googlegroups.com>,
shapper <md*****@gmail.comwrote:
Hello,

I always use EM for text size, letter spacing and line heights.
You should at least stop doing this in the case of line-height.
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.
If you use fixed width of px for a div and the content is wider than the
div, it will look ugly and/or broken
But what unit should I use for padding and margin? EM? PIXEL?
It depends on the context. Post a url of something you are unsure about.

--
dorayme
Jun 27 '08 #2
Scripsit shapper:
I always use EM for text size, letter spacing and line heights.
Good for you and your visitors, if you use reasonable values. However,
line-height is best set as a pure number, for inheritance-related
technical reasons.
For DIV widths I usually use PIXELS if fixed width web site
Why would you suddenly spoil everything and set a fixed width in pixels?
Suppose you set a width of 800 pixels; how many characters will fit in,
horizontally? The only correct answer is "I don't know" or "It depends".
But what unit should I use for padding and margin? EM? PIXEL?
The answer is obvious if you think _why_ you use the em unit for text
size and related matters, assuming you understand the reason and aren't
just following some guideline without knowing why.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 27 '08 #3
On May 6, 2:05 am, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<195ae751-1de2-43f6-b81a-a3b90e07f...@b64g2000hsa.googlegroups.com>,

shapper <mdmo...@gmail.comwrote:
Hello,
I always use EM for text size, letter spacing and line heights.

You should at least stop doing this in the case of line-height.
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.

If you use fixed width of px for a div and the content is wider than the
div, it will look ugly and/or broken
But what unit should I use for padding and margin? EM? PIXEL?

It depends on the context. Post a url of something you are unsure about.

--
dorayme
"You should at least stop doing this in the case of line-height."

Yes, I understood that one hour ago. It also seems the CSS validator
has some problems with unitless values so I need to use 1.0 instead of
1.

Thanks,
Miguel
Jun 27 '08 #4
On May 6, 7:22 am, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit shapper:
I always use EM for text size, letter spacing and line heights.

Good for you and your visitors, if you use reasonable values. However,
line-height is best set as a pure number, for inheritance-related
technical reasons.
For DIV widths I usually use PIXELS if fixed width web site

Why would you suddenly spoil everything and set a fixed width in pixels?
Suppose you set a width of 800 pixels; how many characters will fit in,
horizontally? The only correct answer is "I don't know" or "It depends".
But what unit should I use for padding and margin? EM? PIXEL?

The answer is obvious if you think _why_ you use the em unit for text
size and related matters, assuming you understand the reason and aren't
just following some guideline without knowing why.

--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
Yes, I understand the reason ... with EM when text size increases so
it will the padding and margin.

About the fluid versus fixed ... in the web site I am building I have
two requirements:

1. The web site has a flash movie which should expand all width of the
layout.
To be honest I don't know if a Flash movie should be expanded or
not.

2. The web site must display flash papers documents online.
I need to display the Flash Paper documents with at least 800px
width.
Again I also don't know if I should make the design fluid with
Flash documents in it.

These are the reasons why I am using Fixed Layout instead of Fluid
Layout.
Not sure if I am taking the right option but ...

Anyway, any suggestion is welcome.

I have been always reading about Elastic layouts. Does everyone use
it?

Thanks,
Miguel
Jun 27 '08 #5
Scripsit shapper:
"You should at least stop doing this in the case of line-height."
You're supposed to quote just the relevant part, instead of a fullquote
_and_ a quotation of the relevant part. Google for "how I quote on
Usenet".
Yes, I understood that one hour ago.
OK. What were we supposed to get from this information?
It also seems the CSS validator
has some problems with unitless values so I need to use 1.0 instead of
1.
What? You seem to have misunderstood something completely. Changing
values in your style sheet just to deal with an assumed CSS Validator
bug is perverse.

Then again, if this is still about line-height, then 1.0 is almost
always too small for any normal text, but so is 1.1, except perhaps for
fonts like Calibri that utilize, on average, a fairly small part of the
height of the font.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by delerious | last post: by
9 posts views Thread by Paul McKenna | last post: by
7 posts views Thread by Gustaf Liljegren | last post: by
36 posts views Thread by phil-news-nospam | last post: by
10 posts views Thread by Alan Silver | last post: by
11 posts views Thread by sllrphoto | last post: by
8 posts views Thread by rodeored | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.