89 Comments
- dave_colorado, on 10/12/2007, -1/+15rendering correctly is the least of your concerns...at least from a software design perspective.
what is most important?
1. The MAINTAINABILITY of your website. You will have to make changes, make it easy on yourself.
2. How UNDERSTANDABLE/READABLE is your code? Others may have to change it, it needs to be readable.
3. Functionality. Now we can talk about your page rendering correctly.
Here's why I think CSS XHTML is better. I recently redesigned my website (30 pages) from HTML with tables to CSS XHTML that is, for the most part, tableless.
What was my big payoff? --
The average page code decreased in code size by about 80%. The CSS solution is 80% less code. That means that I have less code to maintain, it's easier for others to read, and it's faster for me to write.
So your page rendering correctly is important. But it isn't the reason to choose HTML with tables. With any route you take, having a site display perfectly on every browser is a serious challenge. - frankiejr, on 10/12/2007, -3/+16I needed only one reason.
Two days ago, I interviewed for a site developer position for a really big web firm I've wanted to work for for a long time. They didn't even interview anyone else because I was the only one that applied with CSS and XHTML skills.
I got the job an no one else even got a reply.
Good enough reason for me. - vh1`, on 10/12/2007, -1/+11"...Well, yeah, everything is cached, CSS or not, unless a user turns their caching off."
the point is: external css file is a few kilobytes downloaded once. but if that same css is included in each page, then it will be downloaded each time a page is loaded
you're right though, these reasons are weak. "because they're doing it", wtf? - MarkByers, on 10/12/2007, -3/+12'XHTML isn't XHTML anymore if you send it as text/html. There are no advantages of XHTML over HTML 4.01 strict right now.'
The solution is to send it as application/xhtml+xml to modern browsers, but send it as html/text to Internet Explorer. Eventually Internet Explorer will support XHTML too, then we can drop that hack. - inactive, on 10/12/2007, -3/+12"39. Blink tag is gone"
Actually its still there.
[CODE]
#div {
text-decoration:blink
}
[/CODE] - cybernetic798, on 10/12/2007, -3/+12Actually even with XHTML/CSS, you are supposed to use tables for data presentation. You're just not supposed to use it for page layout and aesthetics.
- Milan123, on 10/12/2007, -12/+20XHTML isn't XHTML anymore if you send it as text/html. There are no advantages of XHTML over HTML 4.01 strict right now.
http://jero.net/blog/2005/04/why-html/ - Shinglor, on 10/12/2007, -1/+5Actually there is a way to do grids in CSS using display: table, it's just not supported by IE yet. See http://www.w3.org/TR/REC-CSS2/tables.html
- acorn22, on 10/12/2007, -3/+7"Eventually Internet Explorer will support XHTML..."
In a perfect world, IE would be web standards compliant, too. - oktobr, on 10/12/2007, -1/+5I use XHTML and CSS because it's much easier to code by hand and minimise file sizes. The file size of your website might not seem like much of an issue, but it's better to survive for 30 seconds after your site hits the front page of Slashdot or Digg than if it only lasts 10.
Also, accessibility is very important, not just for visually impared visitors but for people trying to look at your site using a text-based browser or a hand-held screen.
For true XHTML/CSS evangalism, head over to www.alistapart.com. They have great articles which explain not only how to achieve nifty effects, but why you should care. - tintub, on 10/12/2007, -1/+5Tables aren't obsolete. There is still no decent way to do a grid in CSS (as far as I can see) without using tables. And there's nothing wrong with using a table in this case anyway.
There is a good reason for using CSS. Presentation information is separated from structural and semantic information. The same page can be presented in many different ways without editing the code (e.g. normal web layout, print markup, text to speech browsers, etc.), the HTML code is easier to deal with because it is relatively clean, and changes can be made across the board just by editing one file. - thecwin, on 10/12/2007, -2/+5Well one reason for everyone to design at least standards compliant (table for layout doesn't matter provided it's according to standards) is so that browsers can concentrate less on keeping backwards compatibility with sites that depend on previous bugs due to thoughtless design. Maybe if everything was valid, browsers could be leaner and faster than they are currently.
- tintub, on 10/12/2007, -1/+4reply to jeffness: (why can't I reply to your post btw do digg comments only allow one level of depth???)
yeah, it can be done, but look at your markup. You are making a table anyway, just calling it something else. That isn't generic, semantic markup... it's still presentation information in the HTML code. It's also a lot more heavyweight than the HTML equivalent. CSS is great, but you have to know not only when to use it, but when not to use it. I'm glad you recognise that it's probably not a great solution and that a table is probably better. Yes it's possible, but the way it has to be done just proves the point that tables are not obsolete. - lo0ol, on 10/12/2007, -1/+4I agree with you, in that the end game should just be about rendering well. However, validating to standards helps with that. It's not always the case, but usually if you code to standards then you have less problems with cross-browser and platform compatibility. The other important aspect to note is that things do change- if you code to standards and a browser changes its rendering a year down the line, it's much more likely your designs won't be broken when that browser makes the changes. Also, there are always browsers out there that you can't really test if you're just coding the page yourself or in a small team. Mobile phone browsers, for example- you can't go out there and test every single phone really. Coding to standards gives you a better probability that your site will work on whichever browser is out there, either now or in the future.
- cathode, on 10/12/2007, -2/+5A lot of really weak reasons.
1) Clean markup eliminates the need for CMS? What a joke.
2) "You will belong in a “movement", make good contacts etc" - Yeah, you're l33t and magically earn "respect"
3) "You can aim to making some money writing a book about it" - Sure, if you could write. - Jaymoon, on 10/12/2007, -1/+4After years of making website after website using tables, I found it very difficult to convince me to switch. All of a sudden one day, I decided to dabble in CSS, and I made a pretty good site (In my view). After I was done building it, I validated it, and to my suprise, other than small things such as closing self tags ( ), my site had passed validation, and I was pretty proud of myself.
The only benefits I would have to say that I noticed is that it's nice to be able to change values through the .css file, and not have to change EVERY page. Another is that the code is much easier to find what I need to change, and I know that by typing in all my code manually, there's nothing in there that I don't want/need.
One recommendation I would suggest though, is not to use one website as your entire CSS refrence. W3schools is a good site, to keep as a main refrence... But if you ever need to know how to make something, just google it. And don't try the first result you find. The best examples I found were buried deep, and I soon realized that different people have different interpretations of the same thing. One persons "horizontal css menu", is more than likely, completely different from another's..... - aepex, on 10/12/2007, -6/+9Although I fully support XHTML and CSS-based layouts, these particular reasons are kinda....weak.
Example from the site: "CSS files are saved in browser cache for fast retrieval and less bandwidth use"
...Well, yeah, everything is cached, CSS or not, unless a user turns their caching off. - SKETCHi, on 10/12/2007, -3/+5Looks like he tried to stretch things out a lot... probably could have done it in a top 10 instead of 55. Still cool though, and some good points were made.
- w0rd, on 10/12/2007, -1/+3Saying "What are the chances that a blind person is going to view my shoddy website?" is like saying, "I don't need a disability access ramp because the chances are slim that that sort of person will visit my store."
- VaporBro, on 10/26/2007, -5/+747. XHTML has a cooler name than HTML
- aThing, on 10/12/2007, -1/+31. All XML must be perfectly formed.
2. Then that's the browsers' faults. - Haplo, on 10/12/2007, -1/+3"For example, is not valid in XHTML Strict, you have to use the CSS to make the text bold."
What is bold? You mean emphasis, or strong, so use those tags. Yeah, em is one letter more compared to b, and you have to type it twice, but if next week you want emphasis to be bold and having a yellow background, there is only one place to change that, your CSS file. Moreover, for devices that don't render visually, bold is quite meaningless, but emphasis or strong gives *meaning* to the text, instead of a visual trick. - BeyondALL, on 10/12/2007, -2/+4This is lame, many of the things in hes list is the same, looks like he tried to make many points over making the points readable..
- Dradis, on 10/12/2007, -2/+4I honestly don't see what people's problem is with CSS and XHTML. Yeah, so maybe these things aren't the greatest thing since sliced bread, but they're still very good things.
I feel like many people simply hate CSS, XHTML and web standards as a whole because these things are currently 'cool'.. and we all know if something's cool it's got to be popular, and if it's popular it's just lame, right? That kind of logic just isn't, well, logical.
Personally I love adhering to web standards because of many above mentioned benefits (and because it's a challenge sometimes), and I love CSS because I can change my whole site's layout just by changing a few variables. It isn't that big of a deal to use CSS and XHTML. Sure, many methods of using CSS for layout etc. are used in a 'hackish' kind of way.. but guess what? Using tables for layout IS A HACK. Tables were never meant for layout, they were meant to display tabular data (imagine that...).
To all the people above who say that the W3C has never published a standard and that they only publish recommendations.. you're right. However, does this mean that the developer community can't come together and make those recommendations into standards? It seems like you're saying 'no' to web standards simply because noone is forcing you to comply.. which is a pretty weak reason indeed. - peorth, on 10/12/2007, -0/+2My favourite is "XHTML has a cooler name than HTML"
- genericface, on 10/12/2007, -1/+3I don't think this list adds anything. If there is a reason why people don't use XHTML and/or CSS it is because of lack of ability. I doubt anyone capable of using XHTML/CSS consciously chooses tables over XHTML/CSS.
Reported as lame. - Bogtha, on 10/12/2007, -0/+1> What does your visitor prefer? Seeing something different or: "Missing end tag for 'p' at line 1313" on a blank page?
That's a false dichotomy. Those aren't the only two options. Where's the QA?
> Don't forget that a lot of pages nowadays are spit out on the fly. One can't guarantee that all are 100% error free unless each page is first checked for well-formedness locally, and then fixed, and then returned.
Three mistakes:
1. You don't have to guarantee 100% error free to avoid XML parser problems, you have to guarantee that the document is well-formed. A document can be well-formed and still have errors in it.
2. You don't have to check for well-formedness locally in order to guarantee that what you are outputting is well-formed. Two examples of where it is not necessary are where you build the output tree with the DOM or similar API, and where you generate the output with something like XSLT.
3. Even if you were checking for well-formedness locally, it doesn't mean you have to do it for each request. Once per update would be effective.
> Like I already said: Netscape Communicator used a very strict HTML parser. They dropped the strictness. Guess why...
I don't believe that. Netscape's browsers have been lax since at least Navigator 1.1. It seems to me they have been getting stricter (entities, table layouts, stylesheet media types, etc). - lo0ol, on 10/12/2007, -1/+2Agreed- tables aren't necessarily bad, either, as long as they contain proper tabular data. The biggest problem I run into today though is vertical centering within a div. It's such a pain compared to the old school ways within a table. There are hack-ish sort of ways to do it, but it still is a pain, especially when you're dealing with data that isn't a fixed height (I usually run into this when I'm trying to vertically center a form element in a header).
- aThing, on 10/12/2007, -1/+2Most of those aren't very strong reasons. Two good reasons not mentioned in that:
Embedding other XML languages in it (SVG & MathML)
Easy to change the design of your website, just by editing the CSS file.
But most importantly, XHTML goes through an XML parser, so it MUST be standards compliant. - lo0ol, on 10/12/2007, -1/+2I used to be of the same mindset- but when you really start cracking on coding and designing tableless layouts with the style stripped from the HTML, it begins to be second nature, at least for me. I don't know the extent of your ability and don't want to make any judgements on it, but for me it just took time before it just started to be comfortable for me to work like that. Now I really don't think of trying to make sure to add trailing slashes or to not embed formatting- it all just happens naturally.
- Bogtha, on 10/12/2007, -0/+1> XHTML goes through an XML parser, so it MUST be standards compliant.
This is not true. XHTML only goes through an XML parser when it is served with the appropriate media type. If you aren't doing content negotiation (bad for caches) and you support Internet Explorer, then you aren't using one of those media types.
Furthermore, XML parsers *don't* require standards compliance. They require that the document is *well-formed*. This is very different to standards compliance. - Bogtha, on 10/12/2007, -0/+1> 1 reason why you shouldn't use XHTML: If it's properly processed by a XML conforming parser if the document is not well-formed *nothing* should be displayed except an error message.
This is not true. If a document is not well-formed, then the XML parser should throw a fatal error. Upon receiving such an error, the user-agent has a number of options - display the content that has already been parsed; reparse the document as something other than XML; display nothing but the error message, etc. Mozilla behaves in the latter way, but it's not required by the specification. The specification only says how the parser should act, not the user-agent.
Unfortunately, a lot of ignorant people think that if Mozilla does it, then that's the way it should be done, so you get these myths springing up that XML requires nothing to be displayed in the case of an error, that XML incremental rendering is wrong, that XML document.write is wrong, etc.
> Welcome to the 80's.
No, welcome to practically any other filetype in the world. What happens if you try and execute a corrupt EXE? What happens if you try and edit a corrupt Word document? What happens if you try and set a corrupt BMP as your wallpaper?
If a file is corrupt, it's perfectly normal to display an error message. We'd be a lot better off if early HTML has this kind of rule, it would have lowered the barrier to entry for browser developers.
> For most sites there is no difference between HTML 4.01 strict and CSS versus XHTML and CSS.
True.
> Imagine using phpBB and suddenly, after a post, you just made the whole board unusable. Cool eh?
Such a situation isn't at all likely. How would such an obvious, glaring bug make it into a final release? In fact, the error handling *reduces* bugs by making them immediately apparent.
> W3C hasn't published a single standard as far as I know.
That depends on what you mean by "published". W3C-authored specifications have gone through IETF standards track, e.g. RFC 2616. - Haplo, on 10/12/2007, -3/+41 reason why you shouldn't use XHTML: If it's properly processed by a XML conforming parser if the document is not well-formed *nothing* should be displayed except an error message. Welcome to the 80's.
XHTML is a huge mistake, and people picking it often have no clue. They just pick it because they think it's better compared to HTML. Do the web a favor: stick with 4.01 strict.
For most sites there is no difference between HTML 4.01 strict and CSS versus XHTML and CSS. However, when the latter has (XHTML) a bug, it might show up as just an error message in a browser. Sweet (not)! Especially nowadays, when a lot of pages are generated on the fly, this might be really not what end users want. Imagine using phpBB and suddenly, after a post, you just made the whole board unusable. Cool eh? (not).
I see several people talking about web standards. The only HTML standard is ISO HTML. W3C hasn't published a single standard as far as I know. They publish recommendations and drafts. So talking about web standards is a bit silly, and very confusing. - mshaheen, on 10/12/2007, -0/+1But by putting pages out there like this one, it is showing those NEW developers/designers more enthusiasm towards best practices. A list like this is obviously not applicable to a seasoned designer. But to someone just getting started it is probably refreshing to see.
- Haplo, on 10/12/2007, -1/+2Maybe you should read on up on XHTML. I don't have a problem with HTML 4.01 strict with CSS, but I do have with XHTML. I have explained my reasons in various comments here.
I don't hate web standards, only what most people call standards are recommendations or even drafts. I don't like the HTML standard (ISO HTML) for the simple reason that the width and height attributes are not allowed for images, which has some disadvantages for rendering purposes if people have a slow connection (or the image is big)
"It seems like you're saying 'no' to web standards simply because noone is forcing you to comply.. which is a pretty weak reason indeed."
I am saying no to calling everything a standard when it isn't. I am a professional freelance programmer and love clear communication (which is a must in my line of work). If a customer asks me to make an application that outputs HTML according to the standard I have to make sure if he means ISO HTML (a standard) or mistakes W3C for a standards organization. Just blindly assuming that my customer means W3C is a huge mistake.
As for not forcing, to me it doesn't matter if, for a project, I have to follow a standard, a recommendation, or some doodles on a napkin. I have no problems with adhering to a specification.
I do have problems with XHTML though, the main one is that errors suddenly become the problem of visitors, not of the developer. Which is plain wrong IMNSHO. A better option is to use XML internally, and output HTML 4.01 strict.
Some people think that CSS only works with XHTML, which is a huge mistake. And for most people, what XHTML adds, they are not using. And I have the feeling that most even don't understand what well-formed means, and the issues *your visitors* might walk into. - jerven, on 10/12/2007, -1/+2Just remember the alt properties for the blind etc... who cannot parse images :)
- Apethanon, on 10/12/2007, -2/+2You don't need to use CSS to make your text bold; just use . Likewise, replaces for italics. Personally, I think this is a change for the better. Bold was often used on long blocks of text that wasn't meant to be emphasized, which is an example where "font-weight:bold;" should be used. For emphasizing text, and are both semantic, and get the job done as easily as and .
Likewise, I find trailing slashes a great improvement. When scanning through the source of a page, seeing something such as appears as if it is missing a closing tag (Even though I'm well-aware which tags don't require a closing tag, it looks like an error when quickly looking through code). Adding the closing slash is only one additional keystroke, and it makes the code so much more readable once you are used to incorporating it.
My biggest gripe with XHTML strict: Removal of the target attribute on anchors. Although it is truely behavorial, and ergo should be handled by client-side scripting, it is a simple enough feature that leaving it in the specs would do no harm. Properly designed links using JavaScript to open new windows are fine, but more and more often sites are using "javascript:window.open(...)" in the href of the link to accomplish the same task. This breaks tab support, and is generally a pain in the ass to all involved (Especially for those who disable javascript). - Haplo, on 10/12/2007, -3/+3(Available for 28476 Seconds) that's quite some edit time :-) (And hmmm, doesn't let me edit)
- rekka, on 10/12/2007, -1/+1I'm inclined to agree with a great deal of that article. I was forced into using tables recently. It wasn't a very pleasant experience.
- Haplo, on 10/12/2007, -1/+1Forgot to mention that it's perfectly possible to make hard to read code using XHTML. Some people think that a language somehow is able to teach people to code readable. A joke.
- cybernetic798, on 10/12/2007, -2/+2I think the only reason ppl don't adopt XHTML/CSS model is because so many common tasks require more work now. For example, is not valid in XHTML Strict, you have to use the CSS to make the text bold. Adding all those trailing slashes is also a pain. And let's not get started on browser incompatibilities. Recently I made a new layout for my site in XHTML/CSS and it was only then that I began to appreciate how much work goes into making sites compliant with standards (for the future) as well as compatible with browsers (for today, until browsers get it right).
Luckily, there are many sources to learn from. Apart from books, there are MANY sites that document CSS quirks and tricks and have tutorials:
http://www.alistapart.com/
http://www.mezzoblue.com/zengarden/resources/
http://www.w3schools.com/css/default.asp
I have to say though, that there are so many cool things you can do with CSS, so in the near future sites should be looking pretty slick. Above all though, the biggest reason for me is to simply standardize. - jagnum1fan, on 10/12/2007, -1/+1Also, when you use extensive images, it requires more bandwidth and, therefore more loading time. This is not a good thing for when you might get dugg.
I think there are more disadvantages to using more images than to use less. - Haplo, on 10/12/2007, -3/+3There is *no* reason that this can't happen with HTML. I mean, nobody is going to stop a browser from using XML for representing the HTML parse tree internally (after fixing errors, of course).
- mixd, on 10/12/2007, -3/+3Hey, did they say CSS? I've heard of that before, I think I'll digg it! Wow! CSS, unbelievable!
- jinexile, on 10/12/2007, -2/+2Actually it has significant advantages over HTML+CSS the problem is that these advantages cannot be explored in depth without cutting off IE users completely.
- Chupatumama, on 10/12/2007, -0/+0CSS to design web pages?
You dont say?
What will people think of next?
Fave Firefox extensions? - Haplo, on 10/12/2007, -2/+2"often sites are using "javascript:window.open(...)" in the href of the link to accomplish the same task." (Don't we love this 1 level reply system).
javascript:window.open() in the href is plain wrong, see: http://johnbokma.com/websitedesign/intrusion/pop-up-windows.html how to do it the right way. - popstalin, on 10/12/2007, -0/+0The only reason I could think that XHTML could break any kind of web application is if it was coded wrong to begin with. I recently went through this with our web developers who swore up and down the reason their code was breaking was because of XHTML. In a sense they were correct because they were declaring IE specific element tags. Once they used standards-compliant code, problem solved. I often find it is web developers who have the most issue with standards compliancy and fight it tooth and nail--at least that's how it is in our shop--because they don't want to have to learn anything other than what they did during their Microsoft Certification class. As a matter of fact, he went right to the Microsoft site to research the problem, who of course didn't have the solution.
- Twinsen, on 10/12/2007, -1/+0Howabout we ditch HTML/DHTML and standardize on something more relevant to the day and age (something with the expressiveness of Flash but the performance of native interface)! ;o)
http://www.justsuppose.com/blog/2006/03/down-with-dhtml-call-to-arms.html - cwmonkey, on 10/12/2007, -3/+2If you're having troubles with or not seeing the advantage of css+xhtml you're doing something wrong.
learn2code -
Show 51 - 85 of 85 discussions



What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official