|
Author |
Message |
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sat Jan 03, 2004 12:04 am (21 years ago) |
|
When writing HTML many people often overlook one of the most important things (at least from a techinal point of view). It's just as important that your code conforms to the standards (as defined by the World Wide Web Consortium) as it is that the site looks good.
"Why should I bother?" you might ask. I had a conversation with my brother (a designer) about this exact thing once. He made the argument that as long as it looks right on his target platform, it doesn't matter that the code is right - if it works, it's good enough. The only problem with this argument is that it's not good enough, and it won't always work. The idea behind conforming to standards is predictability of code. When writing a HTML interpreter, the programmer doing the work needs to be able to predict what code his software will encounter - in order to avoid unpredictable results. Using strict standards is the only way to achieve this.
I'm sure many of us remember how bad old versions of netscape were - but the truth is that the problem wasn't that netscape was coded badly, the real problem was the lack of standards. At the time, Microsoft were desperately trying to crush their only rival in the web browser world. Netscape and Microsoft were in all out war, and so tried to make their browsers incompatable. This of course meant that only one browser could win, and that browser was IE. The result? Most web sites were written to conform to the way Microsoft thought, and Netscape became mostly useless.
To stop things like this happening again, the W3C created and maintains a set of standards. By conforming to these standards, you ensure that your code will work in any browser which also follows them. These days, most browsers do - in my opinion, Mozilla is the best at doing so; IE is the worst of the big names, but does not fail in any crucial areas.
So, it is definately worth your while learning how to code to a standard version of HTML - or better yet, XHTML. Doing so with only a list of rights and wrongs would be nearly impossible, so luckily the W3C provides some online tools to get the job done. Their HTML Validator and CSS Validator can be used at no cost to check any freely accessable page online, and can also be used to check code straight from your computer if you haven't uploaded it yet.
In order to show how this works, I'll show you two examples of sites which try to conform to the standards: our beloved 4WebHelp is the first, and my site (moosoft.net) is the other.
The validator results for this site show that the XHTML markup is nearly perfect (at least for the home page).
The results for moosoft.net show that the code on the homepage (to my surprise) does not conform to the standard. There are a few errors (which are infact due to the code automation of my chosen blog script), and the validator quickly and easily pointed them out to me - you can easily see that I have <p> tags nested inside each other, which is not correct code. It will now be easy for me to correct this error - though I will refrain from doing so for a while, so this example will be available.
The CSS validation results for moosoft.net and 4WebHelp both show that the CSS is completely valid.
Hopefully you can all see what a powerful tool the W3C validators are, and also how valid code is important. Anyway, that's enough of a lecture for now happy coding |
________________________________ It's turtles all the way down... |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sat Jan 03, 2004 9:56 am (21 years ago) |
|
Great post Adam!
Now to stickify it
Also may I point out that if you don't hand code, there are several options in the most recent versions of Dreamweaver to output (at least) more valid code. Just ask if you can't find them in the jumble of options Dreamweaver has . |
________________________________
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sat Jan 03, 2004 12:36 pm (21 years ago) |
|
heh...typical, I forgot to sticky it |
________________________________ It's turtles all the way down... |
|
|
|
phryxus
Junior WebHelper
Joined: 16 Nov 2003
Posts: 46
|
Posted:
Sat Jan 03, 2004 2:22 pm (21 years ago) |
|
It should be nice if you make a tutorial for this. |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sat Jan 03, 2004 2:25 pm (21 years ago) |
|
I'm not sure if there's substance here for a tutorial. What other things would you want in it? |
________________________________
|
|
|
|
phryxus
Junior WebHelper
Joined: 16 Nov 2003
Posts: 46
|
Posted:
Sat Jan 03, 2004 6:44 pm (21 years ago) |
|
Giving information about what you should to do to get better working websites (scripts). You can use validators as one of the steps. |
|
|
|
|
fifalove
Junior WebHelper
Joined: 09 May 2015
Posts: 2
|
Posted:
Sat May 09, 2015 1:09 am (9 years, 8 months ago) |
|
so great |
________________________________ fifachampion | runescape 07 gold |
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.139395 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |