Why I hate CSS

August 18, 2005

Okay, so the title is a bit extreme… but I’m really getting fed up with a few things in CSS. Why is it that it takes me an hour to get things aligned? Why is it that I have to bend over backwards to get the same page to look the same way in more than one browser??

I’ve drunk the whole “web standards” coolaid - I know the value in staying away from tables for layout, and trying CSS tricks for drop shadows and nifty corners. But at what cost? So I can join the “elite” CSS gurus in the ivory tower of tableless webpages?

Well - poop on it.

I’m using tables again. No, I’m not going gang-buster like the folks at Slashdot and use a zillion tables to do everything. But let’s face it - when you want things to line up - rows and columns kinda do the trick. And it ain’t that hard to do. Oh, suuuuure, my code is little messier - but NEWS FLASH! USERS DON’T CARE ABOUT THE SOURCE! So why do WE care so much?? Why do I care so much?

Sorry - I’ve just been banging my head against the wall trying to get two boxes side by side. Simplest thing in the world, right? Sure… if I didn’t have a copyright footer at the bottom that keeps popping up right smack in the middle of my boxes. I was beating that dead horse for hour and then just threw it in a two-column table. BANG! Everything lined up - in both major browsers. Geesh, I feel so… dirty. Eeww… tables are evil!

Well, I once I got over my oh-my-gosh-I-used-a-table guilt, I pulled up good ‘ole IE (I develop with FireFox) to view the same page.

Yea, see… I was trying to use pure-CSS corners to round out my boxes. Works great - till you put it in a table - and then IE screws it all up.

Well, now that’s pickle, ain’t it? Is it any wonder that all the major e-commerce sites use tables for their layout and images for their “nifty corners”?

Oh well, I guess one doesn’t make money by being a purist.

*sigh* Now my head hurts.

Posted in Technorant

4 Responses to “Why I hate CSS”

  1. Jon Says:

    Did you try using floats to align your boxes?

    I mean, you could still use a table-like layout without really using tables… In other words, something like this:

    Left
    Right>

    This, of course, is just a raw example but it may help you to get you started.

    Cheers

  2. Paul Kimbrel Says:

    Thanks, Jon. I’ve since figured out a lot of what I was doing wrong. It’s still a frustrating thing for me to work with CSS sometimes. Sometimes the simplest thing can cause maximum frustration.

    A few things I was doing wrong - I had a right-aligned object appearing after the content that was to be aligned to the right of. This just doesn’t work. It must appear before the content it’s to be alinged around for it to pop over to where it should be. This isn’t the first time I’ve done this. Hopefully, it will be the last.

    Also, I found a nifty trick to forcing div’s at the bottom of my content to stay down below my floated div’s:

    #footerDiv
    {
    clear: both
    }

    This tells the footer div to stick below both floated left and floated right blocks above it. Now that I’ve found it, I’m noticing it in more and more CSS files, so I guess this ain’t rocket science, but until now, I had never seen that one before.

  3. mooreted Says:

    There are lots of people, including me, that think CSS sucks. There is nothing wrong with using tables. There is no point in jumping on the CSS2 bandwagon. Tables for layout, CSS for text.

  4. Paul Kimbrel Says:

    You know, I’ve generally gone back and forth on the issue. I certainly see the merits of a tableless layout. Some of the stuff they’ve done over at the CSS Zen website is absolutely amazing.

Leave a Reply

Powered by WordPress