Forum Moderators: open

Message Too Old, No Replies

Writing Good, Valid html/xhtml

A Standards Document

         

BlobFisk

1:14 pm on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi All,

I have been asked to write a standards document for work. Basically this would act as a reference-type rule book for the developers on how to properly structure, format and write the presentational layer of sites (ie html/xhtml).

I would really appreciate your suggestions, comments and input as to what should be included, highlighted and stressed. Naturally, I will make this document freely available to the WebmasterWorld members when it is completed.

I'm just starting this project now so I haven't really given a whole lot of thought to headings, but off the top of my head here are some of the things I would like to include:


  • Doctype definitions
  • Deprecated tags
  • CSS-1 rules and useage
  • CSS-P rules and useage
  • Accessability
  • Div's versus tables

I look forward to your thoughts and insights and I hope, once I am finished, I will have an informative and useful guide to share with you all.

Regards and thanks in advance,

BlobFisk

papabaer

3:06 pm on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello BlobFisk..!

Formulating guidelines is always be determined by the limiting factors involved and the level of scalability desired. It's dealing with realistic, present day constraints in a pragmatic manner while anticipating future trends and requirements.

Some decisions are easy:


  • eliminate all vestiges of deprecated tags and forget they ever existed.
  • include a doctype that will address current a nd near future requirements.
  • accessibilty is a must.
  • validate your code.

Other choices will be very easy for some, but a more difficult for others:

  • tables are for tabular data only.
  • CSS positioning is limited by your market/user-agent statistics and targeted audience.

One thing is for certain, the future is coming... The question is: how prepared will you be to meet it?

rewboss

5:55 pm on Jul 5, 2002 (gmt 0)

10+ Year Member



One thing is for certain, the future is coming... The question is: how prepared will you be to meet it?

If Netscape have anything to do with it, not at all.

tedster

8:41 pm on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm part of a similar project right now. The main thing I hope to communicate is the principle of separating the visual rendering from the HTML.

With that principle understood, then coding choices become easier. Without that principle firmly in place, people keep using html work-arounds for what really are visual rendering issues. E.g., <br> tags are not a substitute for right use of padding and margin.

The more I work on this, the more I feel we need to create css standards at the same time. I keep seeing bloated and nearly unusable css documents that include new class definitions for every little layout whim that comes along. I'm almost tempted to make one person responsible for the css documents and everyone needs to justify their requested addition to that point person.

Nick_W

8:57 pm on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Come on rewboss, you've gotta break free of the hate netscape thingy! NN4's a bag of ?@!*$ as we know but they're going in the right direction.

If you really need to support it then here's my suggesion:

Do a little browser sniffing and server up a different template for it (tables etc) It's not really that hard and you'll get the best of both worlds ;)

Nick

rjohara

9:45 pm on Jul 5, 2002 (gmt 0)

10+ Year Member



The more I work on this, the more I feel we need to create css standards at the same time. I keep seeing bloated and nearly unusable css documents that include new class definitions for every little layout whim that comes along. I'm almost tempted to make one person responsible for the css documents and everyone needs to justify their requested addition to that point person.

In a centralized organization this is a good practice, and it can support the development of a "house style." Even in a decentralized organization, the availability of voluntary central CSS files that people can cascade under is a valuable idea. Many people unfortunately use CSS just like they used HTML, and create an ID for every element on a page and apply an individual CSS rule to each one. If you do that, you might as well go back to using FONT tags.

The W3C Core Styles project [w3.org] was an attempt to show people how to do this sort of thing. It could be instructive to tell everyone in an organization to link to one of the core styles for a week to get a feeling for how they effect pages and how a common style can be implemented across many sites.

papabaer

9:50 pm on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One of the most common "missed opportunities" I see is for developers to apply styles to the elements themselves. Often they create .class or #id's before taking advantage of "styled elements."

rewboss

8:49 am on Jul 6, 2002 (gmt 0)

10+ Year Member



Well, theoretically, browser-sniffing shouldn't be necessary. The problem is that you never really know in advance how Netscape are going to handle it.

NN6 managed to break an awful lot of browser detection scripts. Many of them were badly-written, but even those that should have worked simply didn't. Coders who wrote if(document.all) for reasons of forward compatibility still had to change all their scripts.

Nick_W

9:01 am on Jul 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I always use php for this and write the scripts myself so I know they work perfectly. (no boast, it's really not very hard)

Recently I've just taken to using @import and making sure the document stands up well without styles. It's not pretty but you can use it...

Nick