I hate CSS

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
those of you who design webpages have probably seen this rant before. still, i needed to rant a bit.

CSS, or cascading style sheets should be used, as their name implies, just for STYLE. and by that, i mean fonts, colors, text size, borders, etc. and yet, the "expert" web design community is pushing hard to use CSS for layouts. now, i agree tables aren't the best solution. although they are simple to understand and use, they are not terribly flexible and can be hard to maintain. you need to use hacks here and there, throw in spacer images, invisible gif's, and so on. so, i certainly understand the motive for developing an alternative to table-based layouts.

but CSS is NOT it. the idea behind CSS was to:

1. separate presentation from content
2. remove the hacks needed to make tables layouts work
3. save you time
4. give you far more powerful presentation options

the css zen garden is a brilliant example of what, in theory, could "easily" be achieved. however, as soon as you go beyond a simplistic, blog-like site, it's hard to put into calm, rational words how badly CSS fails to achieve those goals.

first of all, it's completely unintuitive. many constructs that we were used to - and those that make logical sense - are gone. for example, there's realy no "align=center". instead, in a bizzare decision, you instead mess, at times, with margins, at other times with text-align: center, other times with relative position, and then every now and then, absolute position. some of these work for block elements... some for inline... some not at all.

it's also a horrible pain to figure out the relationship between containers in CSS. with tables, it was very obvious how cells interacted. with CSS, the geniuses behind it figured it was way more obvious to make you use float:left to bounce items randomly around the page. that, or use a ridiculously giant margin and about 30 lines of CSS to get columns positioned properly. how is it people don't realize something is WRONG when you need a full PAGE of CSS to accomplish table tr td td td /tr /table????

of course, all of that would be ok if CSS had proper browser support. now, it's not really the fault of the CSS creators, but it'll make your eyes bleed trying to get your page to look the same in different browsers, not to mention at different versions of the same browser, different resolutions, on different OS's, in different languages, etc... it's impossible. wanna use max-height? sorry, MS decided not to implement it, at all. padding and margin should be simple, right? nope, each browser does it's own thing. and don't every try setting the width to a percentage to have a flexible layout... that's ridiculous and you should be ashamed to have thought of it.

tables, partially as a product of having been around a LONG time, are relatively consistent through out. CSS is anything but. so you end up doing hacks - often to fight with MS's "interpretation" of CSS - using spacer gif's, including tons of javascript.

in the end, with CSS, you end up falling back to fixed size, absolutely positioned layouts laden with every hack and script imagineable. ultimately, your content is again - but now, less predictably - mixed with your presentation, you're using more hacks than before, you've wasted far more time (especially on SIMPLE things like getting 3 columns!), and because the browsers won't cooperate, your design is actually MORE limited than it was with tables.

we need a separate language designed specifically for layouts. let the basic HTML code handle your content. let CSS handle the styling of the content. and let this layout language handle how all the pieces fit together.

bah. i'm done. none of you will read this much text anyway.
 

reverend boltron

Senior member
Nov 18, 2004
945
0
76
Originally posted by: brikis98
bah. i'm done. none of you will read this much text anyway.

Hah, you know, you were right. I tried to read through the whole thing, but once you started talking about the mechanics of it all, and the actual material of the rant, not just the prep for it, I got bored. I got to about "... and then, absolute position." :)

 

Rangoric

Senior member
Apr 5, 2006
530
0
71
I read it and smiled the whole time. This is exactly the headache I've been having with CSS lately.

I've redone it like 3-4 times already because it ends up being more and more difficult to change anything. Especially the more and more creative I want to make the design or anytime I want to just change a little detail. Sometimes its easy, other times its like coding C++ in C.
 

alpha88

Senior member
Dec 29, 2000
877
0
76
Here is what I try to do:

I write all my content as xml.

I write all my layout as xsl (which I use to transform my content xml)

I use CSS to give a theme to the end result.

I do the transformation serverside and output plain old X/HTML (which I send as text/html)
 

GoatMonkey

Golden Member
Feb 25, 2005
1,253
0
0
The thing that bugs me about these sites that claim tables are the scourge of the web, they never mention that you can do a combination of the two. I don't feel bad at all about making a table and applying styles to it. They seem to forget that you can do that in the comparisons.
 
Jun 21, 2007
6
0
0
You are pretty much preaching to the choir here :)

That's why I picked up a Java book some years ago and never looked back. Things are much simpler on the server side :)

No more getting b!tch3d out by egomaniacal, manic-depressive, creatively impaired "graphic designers/artists" because I bastardized their glorious designed-for-print-brochure-ware of a website design layout when I couldn't get column A to align with row B by 2 pixels.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: plzunlockahurtt
That's why I picked up a Java book some years ago and never looked back. Things are much simpler on the server side :)

well, i started making webpages back in ~97 and had 6 or so random jobs over the years doing it... i actually got out of webdesign a few years ago (got sick of all the stupid issues) and have been happily doing software engineering in java, c#, etc since.... however, a random project at work required a web front-end, so i just got thrown back into it.

at any rate, i'm adopting this philosophy:

if i can accomplish the same result w/ css in roughly the same amount of time, i'll do it. otherwise, i'm using a table.
 

mcturkey

Member
Oct 2, 2006
133
0
71
I think you'd find CSS a lot easier to deal with if IE would just be standards compliant. My stuff always looks exactly how it should in Firefox, Opera, and Safari, but I always have to tweak it for IE. Thanks Microsoft!

I used to swear by tables, but some things I've started doing for design can't be done easily (or at all) with tables. And once you start getting into AJAX, tables don't really work either.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: mcturkey
I think you'd find CSS a lot easier to deal with if IE would just be standards compliant. My stuff always looks exactly how it should in Firefox, Opera, and Safari, but I always have to tweak it for IE. Thanks Microsoft!

I used to swear by tables, but some things I've started doing for design can't be done easily (or at all) with tables. And once you start getting into AJAX, tables don't really work either.

i'm sure it would help a lot if IE supported it properly... but it doesn't, and as the vast majority of people use it... it's a moot point.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Originally posted by: mcturkey
I think you'd find CSS a lot easier to deal with if IE would just be standards compliant. My stuff always looks exactly how it should in Firefox, Opera, and Safari, but I always have to tweak it for IE. Thanks Microsoft!

I used to swear by tables, but some things I've started doing for design can't be done easily (or at all) with tables. And once you start getting into AJAX, tables don't really work either.
Even better, in FF, Opera, and probably others, CSS can simulate tables for block elements, offering all of its touted flexibility, with logical layout behaviors, too, across wide ranges of resolutions and font sizes. But no, MS doesn't support that. Oh well.
 

txrandom

Diamond Member
Aug 15, 2004
3,773
0
71
Originally posted by: brikis98
first of all, it's completely unintuitive. many constructs that we were used to - and those that make logical sense - are gone. for example, there's realy no "align=center". instead, in a bizzare decision, you instead mess, at times, with margins, at other times with text-align: center, other times with relative position, and then every now and then, absolute position. some of these work for block elements... some for inline... some not at all.

Just use <div align="center">.

Originally posted by: brikis98
it's also a horrible pain to figure out the relationship between containers in CSS. with tables, it was very obvious how cells interacted. with CSS, the geniuses behind it figured it was way more obvious to make you use float:left to bounce items randomly around the page. that, or use a ridiculously giant margin and about 30 lines of CSS to get columns positioned properly. how is it people don't realize something is WRONG when you need a full PAGE of CSS to accomplish table tr td td td /tr /table????

Although it was a little tough at first, I like dealing with relationship between containers because I think it is easier, and it's what Java (and other programming languages??) use.

I use to be a fan of tables when I first started creating websites. It's fairly easy except messing around with spacers and colspans is annoying. I'd rather set the margin or padding to something.

Supposedly tables take much longer to load, but I'm not sure. From what I've seen it doesn't make too much a difference.

When you use tables to design, you are going to have 30 lines of <table>, <td>, <tr>, etc. Why not just put all the position in one document that can easily be saved to temporary internet files.

Originally posted by: brikis98
of course, all of that would be ok if CSS had proper browser support. now, it's not really the fault of the CSS creators, but it'll make your eyes bleed trying to get your page to look the same in different browsers, not to mention at different versions of the same browser, different resolutions, on different OS's, in different languages, etc... it's impossible. wanna use max-height? sorry, MS decided not to implement it, at all. padding and margin should be simple, right? nope, each browser does it's own thing. and don't every try setting the width to a percentage to have a flexible layout... that's ridiculous and you should be ashamed to have thought of it.

I definitely agree, I've done about 3 sites in the past month where I've had to turn a PSD into a webpage with CSS. Making little tweaks to make Firefox, IE6, IE7, and Safari is tough. Once you learn the tricks and realize better ways of doing things, it gets easy though. Padding and margin between browsers definitely needs to be standardized, but it takes a few days to learn how to make your site cross-browser compliant.

Originally posted by: brikis98
tables, partially as a product of having been around a LONG time, are relatively consistent through out. CSS is anything but. so you end up doing hacks - often to fight with MS's "interpretation" of CSS - using spacer gif's, including tons of javascript.

The three sites I've done so far, I haven't used anything spacer gifs or javascript (for design). I have no idea why you'd use spacer gifs with CSS layouts that's a table thing. :)

Originally posted by: brikis98
in the end, with CSS, you end up falling back to fixed size, absolutely positioned layouts laden with every hack and script imagineable. ultimately, your content is again - but now, less predictably - mixed with your presentation, you're using more hacks than before, you've wasted far more time (especially on SIMPLE things like getting 3 columns!), and because the browsers won't cooperate, your design is actually MORE limited than it was with tables.

I'm not allowed to use absolute or relative positioning at work, and my sites have come out just fine. Three columns takes about 2 minutes to set up.

CSS was a pain to learn, but once you learn it, it's so much easier than messing with tables.
If you need any CSS help just PM me on here or AIM.
Here
is the site made from CSS that doesn't use any Javascript, spacer gifs, or hacks. It's compliant across IE6, IE7, Firefox, and Safari.

 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
I normally try to proselytize css over tables as much as possible, but I really quite liked your rant. Tables are conceptually simple and it's not very easy to emulate that in css. For ease of development I would ideally go with a mix of css and generated tables (whether that be with xsl, php, java, js...; it's pretty easy to make something maintainable like that) except for the notion of user accessibility.

You can make something visually appealing in mainstream browsers with terrible markup but that screws over anyone who wants to use your page differently. Today that might be a screen reader for the blind or it may be google. Tomorrow it might be some new semantic analysis tool that does cool things that you've never thought of. That sort of thing is way easier if you keep your markup clean and don't use tables (except where you actually want to show a table) and I prefer to design that way on principle, so that I can be good at it if it ever really matters. This is all kind of moot because I rarely design anything where I have freedom to use any markup style and have any decent target audience (businesses don't like it when you waste time on semantics without improving the experience in IE).

So there's my little rant... Nice to see some levelness in between the Tables-are-Evil and CSS-is-Stupid groups :)
 

txrandom

Diamond Member
Aug 15, 2004
3,773
0
71
Originally posted by: GundamSonicZeroX
Originally posted by: txrandom
Just use <div align="center">.

That's not standards compliant. ;)

body {
text-align: center;
}

or

#divname {
margin: 0 auto;
}

should work too.

edit-
or use a wrapper container.
 

aceO07

Diamond Member
Nov 6, 2000
4,491
0
76
How do I do forms without tables? I tried putting all the labels and inputs into divs.. but that seems to create a new line for each one. I wanted to make all the labels the same width and on the same line the input.
 

Rangoric

Senior member
Apr 5, 2006
530
0
71
Originally posted by: txrandom
I'm not allowed to use absolute or relative positioning at work, and my sites have come out just fine. Three columns takes about 2 minutes to set up.

CSS was a pain to learn, but once you learn it, it's so much easier than messing with tables.
If you need any CSS help just PM me on here or AIM.
Here
is the site made from CSS that doesn't use any Javascript, spacer gifs, or hacks. It's compliant across IE6, IE7, Firefox, and Safari.

See thats fixed width, I can DO fixed width. And honestly is great at it.

As soon as I have to be able to do variable width, CSS makes me want to strangle the cat to make noises I can't make to explain my frustration.

My most recent anger is looking at you padding, borders, and crap that adds to width AFTER you set it. Especially you borders.

Don't get me started on graphical border on the variable width page. I'll need 3 cats for that one.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: txrandom
Just use <div align="center">.
that's not CSS and is not xhtml compliant.

Originally posted by: txrandom
When you use tables to design, you are going to have 30 lines of <table>, <td>, <tr>, etc. Why not just put all the position in one document that can easily be saved to temporary internet files.

take a look at this site that shows how to achieve several popular CSS layouts. consider, for example, this 3 column layout, an incredibly SIMPLE design. count the number of lines of CSS to achieve it. notice how much absolute positioning, ridiculous margins ("margin-left: 201px"), etc it takes to achieve. pay attention to the "hack" that's included to deal with IE5x and the like.

now, i already admitted tables were NOT the ideal solution, but the above could be achieved with table tr td td td.

Originally posted by: txrandom
I definitely agree, I've done about 3 sites in the past month where I've had to turn a PSD into a webpage with CSS. Making little tweaks to make Firefox, IE6, IE7, and Safari is tough. Once you learn the tricks and realize better ways of doing things, it gets easy though. Padding and margin between browsers definitely needs to be standardized, but it takes a few days to learn how to make your site cross-browser compliant.
as i said, this isn't the fault of the CSS creators, but the number of "tricks" and "hacks" you need to learn, and the tools you have to avoid is absurd.

Originally posted by: txrandom
The three sites I've done so far, I haven't used anything spacer gifs or javascript (for design). I have no idea why you'd use spacer gifs with CSS layouts that's a table thing. :)
ever tried to do a full scale site with a flexible layout? taking into account that IE doesn't have min or max height, and a number of other CSS quirks, you often end up sizing your elements with javascript and or spacer gifs.

Originally posted by: txrandom
I'm not allowed to use absolute or relative positioning at work, and my sites have come out just fine. Three columns takes about 2 minutes to set up.

CSS was a pain to learn, but once you learn it, it's so much easier than messing with tables.
If you need any CSS help just PM me on here or AIM.
Here
is the site made from CSS that doesn't use any Javascript, spacer gifs, or hacks. It's compliant across IE6, IE7, Firefox, and Safari.

your site looks nice, and i congratulate you on it, and have no interest in tearing apart your hard work. but, i do have to say that it's fixed size, does not pass xhtml validation and has few or no moving/flexible parts, so you're avoiding MANY of the CSS headaches i describe above.
 

Skotty

Senior member
Dec 29, 2006
232
0
0
I love CSS for styling. And I hate it for layout. Same boat here. I often try to use CSS for layout, but it's complicated and takes time to figure out. Definitely not intuitive (i.e. centering by setting left and right margin to auto, and then sometimes it doesn't work). And with deadlines always looming, it's hard to stay loyal to CSS when I can do it so much faster using some tables and center tags.