[thelist] RE: auto-sized boxes, and a CSS rant

Jonathan_A_McPherson at rl.gov Jonathan_A_McPherson at rl.gov
Tue Jun 25 15:20:01 CDT 2002

No, I'm not redoing the IRS site -- although I've done my fair share of work
for government sites (mostly SSA).

Yes! I really DO want a left aligned block of text! If I use padding, this

padding = x ems on both sides, looks good
|      +-------------+      |
|      |do this      |      |
|      |do that      |      |
|      |do otherstuff|      |
|      +-------------+      |

change "otherstuff" to "otherbadstuff"
|      +-------------+      |
|      |do this      |      |
|      |do that      |      |
|      |do           |      |
|      |otherbadstuff|      |
|      +-------------+      |

but that's not what I want! I want this to happen:
|    +----------------+     |
|    |do this         |     |
|    |do that         |     |
|    |do otherbadstuff|     |
|    +----------------+     |

Fixed padding is too inflexible for this particular application.

Jonathan McPherson, LMIT/SD&I
Software Engineer & Web Systems Analyst
email / jonathan_a_mcpherson at rl dot gov

-----Original Message-----
From: Techwatcher [mailto:techwatcher at accesswriters.com]
Sent: Tuesday, June 25, 2002 10:32 AM
To: thelist at lists.evolt.org
Cc: Jonathan_A_McPherson at rl.gov
Subject: Re: auto-sized boxes, and a CSS rant

(Aren't you that guy redoing the IRS site? Best wishes!)

You don't really want a left-aligned block of text, do you? You really
want a left margin, am I right? Well, guess what -- you can have a left
margin (or at least, a {margin-left: width}). Only trouble is, as I
just learned from some kind tester on this list, some browsers will get
it wrong. So use the padding-left instead of margin-left. Advantage:
padding applies to the content you're dealing with, rather than some
div you've stuck it in.

You still have that problem with setting a width for padding, but at
least you're thinking more straightforwardly about what you really
want, and it applies to your content (not a meaningless container at a
higher level). Now, if you happen to have a logo that you want to fit
exactly in that left margin, the width of the image tag (plus some
desired value of padding or border around the image) would give you
a "good" absolute value in pixels. Otherwise, you can specify padding-
left and padding-right using some percentage. (Not all browsers can
handle it, but I don't know the details.)

Good luck!

Cheers --
Carol Stein
techwatcher at accesswriters.com

More information about the thelist mailing list