Choosing an HTML version

HTML has been through several revisions since it was first created, and will go through more as time goes on. You may use any version you like, provided that your pages pass HTML validation provided by the W3C and include the test button. As a practical matter, HTML3.2 lacks some features you may find useful, and older versions will lack even more features.

Since our object here is to learn concepts of web programming, and not memorise every feature of a particular version of HTML, I don't want to impose a particular version.

The latest and greatest version is HTML5, but always going with the newest tech runs the risk of leaving some people behind. Another option is XHTML1.1. What you wnat to keep in mind is separating structure and content from presentation: the HTML is for the content; use CSS to control the appearance.

I've started writing all new pages in HTML5, but have many older ones in XHTML and various versions of HTML going back to 4. Normally I just leave old pages as they were when written, changing them only if needed.

DOCTYPE and Validator Buttons

Whichever version you use, you'll have to have a DOCTYPE at the top of your HTML, and a validator link on there somewhere (it usually goes at the bottom, but that's not a requirement). For some versions of HTML there's an official W3C buttons you can use, but all I care about is the link. Here they are:

HTML 5

DOCTYPE
 <!DOCTYPE html>
        
Link code
 <a href="http://validator.w3.org/check/referer">HTML5</a>
        

XHTML 1.1

DOCTYPE
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
        
Button code
 <p>
 <a href="http://validator.w3.org/check/referer">
 <img style="border:0;width:88px;height:31px"
        src="http://www.w3.org/Icons/valid-xhtml11"
        alt="Valid XHTML 1.1!" />
 </a>
 </p>
        

HTML 4.01

For HTML4, you have the option of using the strict version or the transitional one. The difference is that the transitional version lets you use features of older versions that have been deprecated, where the strict version will reject use of deprecated features. If you have written a lot of HTML, you may find that in 4.01 strict will not let you use things you've gotten accustomed to. That may be annoying, but since those deprecated features will eventually go away, you may decide it's a good idea to start adapting to the new standards. In either case, you use the same button code.

DOCTYPE
  1. HTML 4.01 Strict
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
        
  2. HTML 4.01 Transitional
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
        
Button code
 <p>
 <a href="http://validator.w3.org/check/referer"><img
          src="http://www.w3.org/Icons/valid-html401" border="0"
          alt="Valid HTML 4.01!" height="31" width="88"></a>
 </p>
    

CSS Validator Button

This seems as good a place as any to put the code for the CSS button, again with the proviso that all I want is a link:

     <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
            style="border:0;width:88px;height:31px;"
            src="http://jigsaw.w3.org/css-validator/images/vcss" 
            alt="Valid CSS!" /></a>
    

What do I want from you?

Your pages should end with a line like what's on the bottom of this page.

  1. Your name should be a link to your homework 1, which is a list of all your homeworks.
  2. You should have links to both the HTML and CSS validators.
  3. You should have links to screenshots of your page as seen in each of the listed browsers. If the page is really big, scroll to the top, or to whatever part of the page is most interesting.

If something doesn't pass validation, or doesn't look right in a particular browser, that's not automatically trouble. None of the browsers is fully debugged, and sometimes to get it to work in all the possible browsers you have to cheat the HTML. Just mark the link with a bang in parens '(!)' and use the 'title' attribute to indicate the trouble.

D. Provine Valid: HTML5 CSS3 Tests: IE(!) Mozilla WebKit Opera W3M Lynx