The Most Active and Friendliest
Affiliate Marketing Community Online!

“AdsEmpire”/  Direct Affiliate

The purpose of XHTML

ForumJoiner

New Member
affiliate
A HTML file should obey the rules of writing HTML files, but not always does.
A XHTML file must obey the rules of writing HTML files, plus a few others.


A XHTML file that obeys the above rules is called a “well-formed†XHTML file.
A XHTML file that is “well-formed†and its structure conforms to the rules set by W3C is called a valid XHTML file.


W3C is an organization who sets standards for writing XHTML files. Standards are necessary for the browsers on the market to have similar behavior when interpreting the same XHTML file.


Validating a file means to check that file to see if it is well formed and valid. To validate your file / web page, please this official link.
 
The problem is that the most used browser on the market is not standards compliant. In fact, IE has added some functionality to their browser that is proprietary that other browsers don't, nor could they, make use of. While it would be great if everyone would use a standards compliant browser (Firefox, Netscape, or Opera), it won't happen for quite some time. So, because of this, and our need to have our sites visited by every person possible, we must work 5 or 6 times harder getting our sites to work in all browsers, and then spend countless hours trying to make certain that it is compliant.

Here's what I did. I began using tableless layouts, for a single page I would spend about 30 minutes in the design process, then about 10 to 15 hours in the coding process, and another hour validating it. I would have to make sacrifices to the look of my page so that the page would work in IE. Sometimes I would come to a single problem in browser differences that took me 8 to 10 hours to figure out, so you could add that time on top of that. Usually I would end up just getting rid of that functionality, and moving on.

What I do now. F*** IE. They have forced my hand, now I use tables to layout a page. I spend about 30 minutes in the design phase, 1 to 2 hours coding(usually far less), and I about 5 minutes validating the code.

I used to tell people that their sites would be easier to recode and fix if they used proper elements in their coding. Now I tell people that that's BS. Why, because if it takes me an extra 10 minutes to find my way around a page's code, that doesn't come close to comparing to the extra 20 hours I spent making a page more readable and compliant with the w3c standards. The moral? Use tables. It doesn't matter what some consortium thinks about my site, 99.5% of the users that visit my site will never ever look at the code. If my site looks good in all browsers, that's all that I care about. As long as it functions properly. Plus, my CSS is much easier to read, and believe it or not, so is my HTML. (I hate hacks)
 
I agree that CSS programming can be more difficult than table-based. I also know sites (please PM me for details) which look good in IE and FireFox, but not in Opera. I also know for a fact that Google search page itself is coded in HTML + tables for layout.


I come to the conclusion that considering the common part of the standard each browser accepts, it is possible to design a site using a standard set of tags. About this, I will comment more on the CSS forum.


As for XHTML, compared to HTML, I try, whenever possible to use / to plan to use XHTML because the rules to obey are stricter. In the long run, it means those even browsers that are not fault-tolerant can read my code. IE tolerates a HUGE array of mistakes, the most obvious one being the lack of <body> tag, but the IE’s code is bigger than the code of a browser used in a cell phone, for instance. In other words, a cell-phone browser might not have enough space to implement fault-tolerant code, therefore it might read properly only valide XHTML code.


I love to see people arguing about the use of XHTML and I believe anyone interested can make his/her own opinion looking at the arguments, and choosing the best method for a particular application / timeframe.
 
I completely agree with you. I actually do use CSS for my table layouts, but the reason that I do use tables, and the reason it's easier, is because tables are quite predictable. If you see a table behaving a way that it's not supposed to, it will more than likely not be behaving in any browser, so the fix is usually quite easy. vBulletin and SMF also make extensive use of tables. Joomla, on the other hand, works well in IE and FF(I don't know about Opera or Netscape), and doesn't use a single table anywhere. If what I was designing a script that would be used by hundreds or even thousands of sites, I might reconsider using CSS as a means of laying out, much like Joomla has.

But on a single site? I don't think that the rewards outweigh the cost.

As far as validating my XHTML, I still do that, but have found that it's easier to do when you use simpler layouts, like those done with tables. One thing that I have found about XHTML, if a character is used, for instance the ampersand "&", it won't validate. Instead, you must use &amp;(I think). Well, if you are working with PHP, then you must make certain that all of the unacceptable characters are converted first, and that doesn't seem worth it just to comply when what you are complying with doesn't make sense(Why can't you use &?). As for everything else, I always try to validate the code.
 
If you see a table behaving a way that it's not supposed to, it will more than likely not be behaving in any browser, so the fix is usually quite easy.
If you want, I can send you a PM, with an example of a table looking the same in IE and FireFox, but different in Opera. :)
 
banners
Back