472,958 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

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 3159
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: delerious | last post by:
I'm trying to add some simple padding to an IMG by using a padding-right style, but it doesn't work in IE. Works fine in Mozilla and Opera, though. Here's a link to a page which displays this IE...
9
by: Paul McKenna | last post by:
Hello Here is my code: <div> <span> ... Flash object... </span> <span> <img src="a.gif">
7
by: Gustaf Liljegren | last post by:
I continued on the example shown earlier today: http://gusgus.cn/test/index.html Now I get some unwanted space in Firefox (the red space just below the first image) which doesn't appear in...
11
by: muraii | last post by:
Hi all, I've trolled through Google, a little of evolt, css-discuss archives, and sent the list a request, all to no avail. I consulted positioniseverything.net and quirksmode.org. The issue I...
36
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should...
10
by: Alan Silver | last post by:
Hello, In my (seemingly) endless quest to understand CSS, I have yet another problem. Please look at http://www.kidsinaction.org.uk/ph/x.html in Opera, where you will see it how I expected. If...
11
by: sllrphoto | last post by:
A veteran of early html, I've modified my blog template and made it look rather clean (albeit rather plain) when viewed with IE. Ironically, I'm a big Firefox fan, but when viewed in FF, my blog...
19
by: Edward | last post by:
Why is it when I have a DOCTYPE line in my HTML then "margin" and "padding" are ignored? This happens in both inline and stylesheet styles. It happens for both XHTML and HTML doctypes. It...
8
by: rodeored | last post by:
page: http://reenie.org/test/blockpadding.htm code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>test</title> </head> <body> <h2 style='padding:0; border:solid 1px...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.