Coding Standards

August 2, 2007 at 4:57 am (Coding Standards)

   A DOCTYPE specification MUST be used at the beginning of the web page

            o A DOCTYPE (short for ‘document type declaration’) informs the validator which version of (X)HTML you’re using, and must appear at the very top of every web page.

            o Doctypes are a key component of compliant web pages: your markup and CSS won’t validate without them.

           o Netscape 6 and above, Internet Explorer 6 on Windows, and Internet Explorer 5 for Macintosh all support DOCTYPE switching

           o  For XHTML strict:   

           (Use this doctype when you’re not using any deprecated or frameset  tags with XHTML.)    

            <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”             “”>  

             o     For XHTML transitional:  

            (Use this doctype if your document is in XHTML and contains

      deprecated tags.)

            <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”        “”>    

           o  For XHTML frameset: 

           (Use this doctype if your document is in XHTML and contains

      frameset tags and/or deprecated tags.) 

          <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN””&gt;

       Tags and attributes MUST be in lower case  

              o  This is because XHTML documents are XML applications. XML is case-sensitive. Tags like <p> and <P> are interpreted as different tags.

        o  <body>
                   <p><a href=”My Link”>This is correct</a></p>

         Elements MUST be nested correctly.

        o  This is wrong:  

                         <p><b>This is not correct</p></b>

        o  This is correct:                                                      

                  <p><b>This is correct</b></p>

      Attribute values SHOULD always be quoted.         

      o    This is wr

                 <table width=640><tr><td>This is not correct</td></tr></table>
       o   This is correct:     
                  <table width=”640″><tr><td>This is correct</td></tr></table>  
       All pages MUST have a page title. This title will match the heading title at the top of the content section.


                       <title>Nevada Department of Transportation Homepage</title>



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: