NIU HTML Coding Standards Version 1.0
Introduction
The following set of rules are meant to be guidelines to help guide
you as you choose from among the myriad of options available when
creating HTML documents. Most are meant to ensure maximum
compatibility with a variety of W3 browsers available, both now and
into the future. The rest are meant to give some sort of
uniformity to all of the HTML documents available on our site.
There are a lot of "bad" HTML documents out there. If you
use these documents as examples as you're learning to code (and
everyone uses other people's stuff when learning HTML), you too
will end up with documents which various groups on the 'net may not
be able to use. These standards can enable you to separate good
HTML documents from poor ones and learn good coding techniques and
practices.
This standard, like the HTML standard itself, is in a state of flux
and is certainly open to criticism and modification. Please send
any comments about this standard to www@cs.niu.edu. I
would also appreciate hearing about any circumstances in this (or
any other system administration document) where I have not followed
my own standards so that I might sheepishly repent and correct
them.
The Standards
- The names of HTML files should always end with the ".html"
extension
Good: foo.html
Bad: foo.bar
- All command tags should be completely capitalized, in order for
the tags to stand out better from the surrounding text
Good: This text is <EM>emphasiszed</EM>
Bad: This text is <Em>emphasized</em>
- All "HREF=" fields in anchor tags should always be enclosed in
quotes
Good: <A HREF="http://www.cs.niu.edu/homepage.html">
Bad: <A HREF=http://www.cs.niu.edu/homepage.html>
- If you are coding a URL which does not specify a specific file
name, always end the URL with a front slash (some browsers choke if
you don't do this)
Good: <A HREF="http://www.ibm.com/">
Good: <A HREF="http://www.cs.niu.edu/~www/">
Bad: <A HREF="http://www.ibm.com">
Bad: <A HREF="http://www.cs.niu.edu/~www">
- Whenever possible, use logical
formatting tags instead of physical formatting tags--let the
client's browser figure out the best way for the information to be
displayed
Preferred: You should read the book
<CITE>Neuromancer</CITE>
Preferred: This text should <EM>stand out</EM>
Discouraged: You should read the book
<I>Neuromancer</I>
Preferred: This text should <BOLD>stand out</BOLD>
- Always include a <HTML> tag at the very beginning and a
</HTML> tag at the very end of your HTML documents
- Always use the <HEAD> and </HEAD> tags to define a
header section in your HTML documents
- Always include a LINK with REV="MADE" in the header section of
your HTML documents identifying you as the author
Example:
<LINK REV="MADE" HREF="mailto:your_logonid@cs.niu.edu">
- Always give your documents a title by using the <TITLE>
and </TITLE> tags in the header section of your HTML
documents
- Always use the <BODY> and </BODY> tags to define
the body in your HTML documents, which is everything in your
document between the <HTML> and </HTML> that isn't
contained in your header section
- Use the horizontal line tag <HR> to place a horizontal
line beneath any prominent headers in your documents to help them
stand out from the surrounding information
Example:
<H1>My Document's Title</H1>
<HR>
- Always "sign" any HTML documents that you create by including
a horitontal line and a link to your homepage (using the ADDRESS
style) at the very bottom
Example:
...and this is the end of my document's text.<P>
<HR>
<A HREF="http://www.cs.niu.edu/~www/"> <ADDRESS
>WWW</ADDRESS></A>
</BODY>
</HTML>
Other HTML Coding Standards
Return to New User Information