[thelist] why doth i hate css? let me count the ways.

Paul Cowan evolt at funkwit.com
Thu Oct 9 19:22:57 CDT 2003

> 1. Why is there 'font-family' and 'font-weight' but no 'font-color'?

'color' is what you're after.

You don't set the 'color' of the font, you set the foreground 'color'
the area. It just happens that text is one of the things drawn in the
foreground 'color'.

('Color' in quotes because, you know, that's not how you're actually
supposed to SPELL it... *sigh*)

> Why doesn't the following css do what it SHOULD do? How should it work
> you ask? Well it should push the button over to the far right of it's
> container. What happens instead? Nothing. And what happens if I use
> text-align: right;? THE WORD SUBMIT IS ALIGNED RIGHT!! aarggh!

1) There is no 'align' property in CSS.

2) 'text-align' applies to the alignment of text inside the element,
   not the positioning of the element itself. You want to apply
   text-align to the parent block-level element of the input --
   i.e. the <p> or <div> or whatever that contains the input. Or, you
   want to look at using absolute or relative positioning, or float.

> 3. Why is it that when I specify 'width: 200px; padding: 5px;' on a
> <div> I end up with a box that is 210px wide and not 200px? (Technically
> I know why. I just think it's a really stupid way to make things work.)

Much of a muchness really. At least this way, you know what size the
actual content area will be (unless you're using IE5).

> 4. Why can't I easily and with one command center anything vertically?
> (The following code should work like I would expect it to. Not because
> I'm demanding or anything but because IT JUST MAKES SENSE!)

That, I can't help you with. As far as I know, there's no easy non-hacky
way to do this in CSS (that goes for #5 as well). Happy to be proven
wrong though.



More information about the thelist mailing list