News for hackers. Stuff that matters.
Re:Why CSS should not be used for layout by geuis on Monday February 02, 2009 @09:01PM (#463345)
His html example for the 3 column layout is subpar anyway. The wonderful advantage of CSS is that I can create a multi-column layout where the html might put the content div first and the nav last, if I have a reason to do so. My underlying html structure doesn't need to be in any particular order in order to achieve the layout that I want. He completely misses the fact that CSS2.1 has had display: options to do table-like alignment for years. These are well supported in modern browsers, except for IE6 and 7.

I completely recognize this is an argument of "what should be" versus "what is". As it stands though, I have been doing this for years and have never, never EVER needed to use tables for layout purposes. I get that some people are more interested in writing applications and just don't have to time to learn all of the idiosyncrasies that go into dealing with cross-browser display problems. However most of these are easily overcome, most without even needing CSS hacks.

Re:Why CSS should not be used for layout by gnaritas on Monday February 02, 2009 @09:49PM (#463400)
"except for IE6 and 7"

So it doesn't work for the majority of browsers, yea, that's a technique I really want to count on.

Re:Why CSS should not be used for layout by Jem on Tuesday February 03, 2009 @03:32AM (#463712)
That's the fault of IE6 and 7 though, NOT CSS. Blaming CSS for the inadequacies of MS browsers is flawed logic.
Re:Why CSS should not be used for layout by tlrobinson on Tuesday February 03, 2009 @10:38PM (#465216)
It doesn't really matter who's to blame, it doesn't change the sorry state of things...
Re:Why CSS should not be used for layout by tutwabee on Tuesday February 03, 2009 @03:01AM (#463684)
It depends on how you are counting "majority." According to w3schools, IE6 & IE7 combined make up 46% of browsers right now and Firefox makes up 44%.

If IE had taken Opera & Firefox's lead a long time ago we would not still have this problem. CSS is not the problem, support for CSS is the problem.

Hopfully the IE8 will swallow the IE6 & IE7 market because we really need to take advantage of these great "display: table" properties that have been around for the last 11 years.

Re:Why CSS should not be used for layout by arockwell on Tuesday February 03, 2009 @11:23AM (#464149)
w3schools overestimates the firefox share because there are far more web designer/developers going to their site. The actual breakdown is more like 66% IE6/IE7 and 33% FF/Opera/Safari. Opera and Safari are a couple percentage points each.
Re:Why CSS should not be used for layout by Hexstream on Tuesday February 03, 2009 @11:01AM (#464126)
"My underlying html structure doesn't need to be in any particular order in order to achieve the layout that I want."

Sorry but in my experience you do need to tweak your document order to achieve the layout you want.

As an example, I made a (unreleased) site where I have "navboxes" floating on the left and right, and content in the middle. I had to put the floated divs before the content so that the top of the navboxes were aligned with the top of the content instead of having the content and then the navboxes below.

That worked fine but I wanted to have the content first in the document because if someone accesses the page with, say, lynx (yeah, I know) I deem the content more worthy of being at the top than the navigation (that took a lot of space).

Finally I decided to use absolute positioning for the floats I think (there were bad interactions when I put floats in my content), it's fortunate that I had this choice so I could get the document order I wanted.

Re:Why CSS should not be used for layout by eli_s on Monday February 02, 2009 @09:09PM (#463353)
"He completely misses the fact that CSS2.1 has had display: options to do table-like alignment for years. These are well supported in modern browsers, except for IE6 and 7"

haha are you serious? What percentage of people are using ie6 & 7?

I think that layout shouldn't be that complex - lets be honest here we aren't building applications or anything difficult like that - we're layout out text and pretty pictures and CSS often makes this more difficult than it has to be.

That being said I still use CSS as often as I can for layout.

Re:Why CSS should not be used for layout by jonny_noog on Tuesday February 03, 2009 @01:03AM (#463598)
I suspect he was serious, and he has a good point. If IE had supported "display: table" et al, coding CSS would be a hugely different and less confusing/frustrating experience for both the novice and the expert.
Re:Why CSS should not be used for layout by eli on Tuesday February 03, 2009 @10:42AM (#464102)
Sure, and if it supported "display: hologram" we'd be able to surf the web in 3D. But it doesn't, and we can't
Re:Why CSS should not be used for layout by jonny_noog on Tuesday February 03, 2009 @04:54PM (#464755)
I'm really not sure what point your comment is actually meant to convey.

The relevant point which apparently needs clarification is that CSS has had "display: table" for bloody ages and "Blaming CSS for the inadequacies of MS browsers is flawed logic."

If you don't want to use CSS because of the "inadequacies of MS browsers" or because your knowledge of CSS just isn't up to it in relation to particular layout you are trying to achieve, no one is holding a gun to your head. But don't blame CSS for this.

I'm happy to come from the POV of pragmatism. I don't see myself as a CSS fanatic. But honestly, I have been using CSS so long that I actually find it harder to work with tables for layout (as I have recently found when I had to work on a legacy site that uses tables for layout). The markup is so much more verbose than what I am used to now (nested tables are evil, full stop). CSS layouts are clear and uncluttered to me in comparison.

My own experience tells me that if you put the time in, CSS will make more sense than tables for layout and will become easier, regardless of the crappy support from some browser vendors. Whether one wishes to put the time in or not, is up to them.

Re:Why CSS should not be used for layout by eli on Tuesday February 03, 2009 @05:14PM (#464789)
I don't see how this is relevant at all. I'm not blaming CSS for anything. Who cares whose "fault" it is?

My point is that it doesn't matter what CSS could do with the right browser. Out here in the real world, 38% of my site's traffic is IE6. If my design doesn't work perfectly in IE6, then it doesn't work period.

Re:Why CSS should not be used for layout by jonny_noog on Tuesday February 03, 2009 @08:16PM (#465084)
I don't see how this is relevant at all. I'm not blaming CSS for anything. Who cares whose "fault" it is?

OK fair enough, maybe I interpreted the tone of your earlier comment in a way that you didn't intend. But I think it actually does matter whose fault it is to a certain extent though, only becuase people seem to be so quick to jump on the W3C while they give other organisations who sat on a crippled browser for years before Firefox freaked them out enough to get moving again, a comparitively free pass. I agree that moving forward, it really doesn't matter, but for the sake of historical accuracy, yeah it does.

Your argument appears to be that you are unwilling to make use (or at least very much use) of CSS due to the lack of support from IE and that you cannot sufficiently support IE6 with CSS.

I have been making sites with pure CSS that support IE6 for years. For sure it would be easier if IE supported display: table, but it's absolutely possible right now.

Your initial quip implies that it is not possible right now and this is incorrect. If you wish not to implement a pure CSS layout due to not having the time, knowledge or inclination, that's your choice to make with your projects. But understand that this is all that holds you back.

Incidentally, 38% is a pretty low IE6 stat, I envy you... If any of the sites I support hit that mark, I would seriously start thinking about dropping support for IE6 on that site all together, or at least looking at graceful degredation/progressive enhancement possibilities.

Re:Why CSS should not be used for layout by notphilatall on Tuesday February 03, 2009 @01:59PM (#464434)
You're not building applications? I hope you are referring to your specific case - Those of us who are dealing with a significant JS layer need to use every feature CSS and HTML5 have to offer us.
Re:Why CSS should not be used for layout by eli_s on Tuesday February 03, 2009 @06:14PM (#464922)
That's a whole different kettle of fish altogether! If you're building an application that requires JS then you have the power to completely modify the DOM, reorder elements, position absolutely and adjust position based on screen size etc - in this scenario you are no longer tied to CSS limitations or browser inconsistencies :)

Now if only 100% of people had JS turned on things would be peachy :)