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

Mike Migurski mike-evolt at teczno.com
Thu Oct 9 19:25:48 CDT 2003

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

see 'color'.

>2. With the following html:
><input class="submit" type="submit" value="Submit"/>
>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!
>input.submit {
>	align: right;
>	}

There is no 'align' property - did you just pull that out of your hat?
You're thinking of 'text-align' perhaps, and it does not push something to
the right in its container, it pushes a container's contents to the right.
The difference being that you should apply it to the element that
/contains/ the input element. Float and block display might help you do
what you want to do in the above example in the way you're trying.

>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.)

See: box model. The 'width' refers to the content width. It could, I
imagine, just as easily have applied to the content + padding if they had
chosen to spec CSS that way, but then there would be no way to correctly
determine whether fixed-width items like images could correctly fit /into/
a box with variable-with padding (to give one example). I'm sure there are
reams of publicly-available archives from some W3C list with PhD's
wringing their hands and making lifelong enemies over this issue.

>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!)
>5. And along the lines of #4, why can't I make a box stretch 100%

Not sure, but I imagine it has to do with the inherent inexactitude of
determining vertical dimensions and their relationship to text flow and
horizontal dimensions. Why not just use absolute positioning and overflow?

Any tool is frustrating when used incorrectly. Here are the instructions-
CSS1 guide: http://www.htmlhelp.com/reference/css/
CSS2 spec: http://www.w3.org/TR/REC-CSS2/

michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

More information about the thelist mailing list