Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   HTML / XHTML / CSS (http://www.programmingforums.org/forum27.html)
-   -   Why is CSS such a mess? (http://www.programmingforums.org/showthread.php?t=14192)

Dameon Oct 20th, 2007 12:22 AM

Why is CSS such a mess?
 
It's a great way to change background colors site wide.

But it seems so horribly broken for what it's used for.

The tools given aren't particularly sane for page layout. One should be able to set up whatever constraints (equal, proportional, parallel, etc) as needed and the agent displaying the content finds a suitable solution. As an example, the login div must be equal width as the sidebar div, the sidebar div is at the left of the screen, the navbar is at the top of the screen and above the sidebar, and the content div is below the navbar and to the right of the sidebar. If everything is in a box, it would make sense to use other boxes as a reference point, rather than the screen. Tables are much more intuitive for layout purposes, but simply aren't capable enough. We can do what we need with CSS, but everything along the way is a messy hack.

Why would a spec for something that needs to be pixel-precise not come with an example implementation?

If the point is to separate content and presentation, then why must I change the content to get the effect I want?

cscgal Oct 20th, 2007 12:36 AM

Re: Why is CSS such a mess?
 
I'm pretty good with CSS but I'm not exactly sure what you're describing? Creating multi-column layouts in CSS is actually relatively simple.

Here's an example of a two column tableless layout => http://www.daniweb.com/code/snippet684.html
Here's a really good site to go to for CSS tutorials => http://www.alistapart.com/articles/

Grich Oct 20th, 2007 12:43 AM

Re: Why is CSS such a mess?
 
I used CSS a while ago, it is a bit confusing and messy at times.
What you have to realise is that it is a scripting language for Designers. If you meet a designer (a real one) you will understand why CSS is like the way it is.

Wizard1988 Oct 20th, 2007 1:36 AM

Re: Why is CSS such a mess?
 
It is a mess if you have to make it work across different browsers, otherwise its not that bad.

Arevos Oct 20th, 2007 6:19 AM

Re: Why is CSS such a mess?
 
I tend to agree with Dameon on this. CSS is pretty awful at layout. Sure, you can get around it with numerous "two column" techniques, but if CSS was designed properly, then it would be much more obvious how to achieve such layouts.

You can make arbitrary elements act as tables, but I'm unsure if this works with IE. I seem to recall it doesn't.

A lot of things about the web could be better. HTTP, for instance, is a poor protocol for many of today's more complex AJAX applications. Some support for SVG on IE wouldn't go amiss, either.

Alias Oct 20th, 2007 8:13 AM

Re: Why is CSS such a mess?
 
Here is another in agreement. But actually I steer clear of web-development and never intend to get drawn into it - the whole thing seems ugly and unstructured. The really really sad thing is, that, they, are bringing this generation of design to application development with XAML for .NET.

The thing I have found awkward about writing HTML/CSS code for layout in the past is the fact of the buff's dedication to a set of unwritten(?) standard's. Yes we could do what we want, and easily, seemingly with no errors, but show a buff and their reaction never fails - 'You should'nt use that there, or that here, or this there'. Okay, so maybe we should'nt use tables for laying out and it's not results from the clients db table I want to display, but it works, browser's don't get upset by them, generally speaking, and you spend alot less time phaffing.

That's my opinion anyway.

DaWei Oct 20th, 2007 10:10 AM

Re: Why is CSS such a mess?
 
"Separating content and presentation" is a worthless buzz phrase, without clarification. Bolded text (presentation) carries meaning (content). Granted that it's nice to be able to bold an entire class of things (section heads, say), one needs to distinguish between presentation that is merely a stylistic or formatting issue and presentation that adds to the meaning of the document.

The problem is that disciplines almost always breed a class of people that I call "high priests." The people issue dictums to their acolytes and expect 100% compliance and obediance; no independent thought, and no exceptions. A "kiss my ring and the hem of my robe, you little effer" kind of thing.

Another problem is with the rendering engines, themselves. Even "compliant" browsers choose to set their own values for certain defaults. Examples would be margins, paragraph spacing, and so forth. The only solution to this is for the designer to "zero out" all the default values and set them all from scratch to the values he or she wishes to use.

After that, one then hacks for "non-compliant" browsers.

All that said, I personally prefer the CSS approach, applied semantically. That isn't to say that there aren't things that make me regularly grit my teeth and mumble imprecations.

I highly recommend A List Apart, linked to earlier in the thread. It's very good, but it isn't God's Word, so keep a couple of your brain cells under your own control.

Dameon Oct 20th, 2007 2:03 PM

Re: Why is CSS such a mess?
 
Quote:

Originally Posted by Arevos (Post 135406)
A lot of things about the web could be better. HTTP, for instance, is a poor protocol for many of today's more complex AJAX applications.

A standard protocol extension for server-push would be delightful.

Quote:

Originally Posted by DaWei (Post 135409)
"Separating content and presentation" is a worthless buzz phrase, without clarification. Bolded text (presentation) carries meaning (content). Granted that it's nice to be able to bold an entire class of things (section heads, say), one needs to distinguish between presentation that is merely a stylistic or formatting issue and presentation that adds to the meaning of the document.

The former actually works sanely in CSS. Section heads in your example will be tagged appropriately because they are distinct from something such as section text. One could just drop in a new style sheet for, say, paper printing without touching the main document. The issue is that, in order to achieve a desired layout, one must often add superfluous elements or move things around just to work around the limitations of CSS. The data and style then start to become interdependent, which defeats the purpose of separating them in the first place. If it's not just a matter of making the section headings a little bigger on paper, and things need to be arranged in a way more sane for print, one will quite possibly end up with two separate documents. Many sites end up offloading the insanity to a server side script that generates printer-friendly pages, creating yet another area tainted with aesthetics.

Booooze Oct 20th, 2007 5:37 PM

Re: Why is CSS such a mess?
 
I haven't done CSS for a while, but I remember how much of a pain it was trying to get it to work properly over cross browsers. I'm not going into detail, but I would agree with the idea that it could have been done better. I just love being able to change styles for the whole page at once. That's the biggest plus. Layouts get tricky.

DaWei Oct 20th, 2007 7:56 PM

Re: Why is CSS such a mess?
 
Unfortunately, things get tricky. C++ is as good an example as CSS. One solution is to get on a standards committe, fight for 5 years or so, and still lose half the battles.

The other solution is to gut it up and do the best you can do in the face of constraints imposed by those deal in words and taurine excrement, rather than deeds.

Don't get me wrong: some of those who contribute to laying down the rules are extraordinarily sharp. They, too, fight losing battles. Web "standards" (I know of no actual standards, but who's counting) seem to be particularly lacking. Perhaps the best people are busy elsewhere.


All times are GMT -5. The time now is 3:24 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC