CTEC1906/2012W Checklist for Proper HTML ========================= [ ] DTD at the top of the document [ ] tag [ ] tag [ ] [ ] embedded CSS in head <style> </style> or in separate .css file referenced by <link> tag [ ] </head> tag [ ] <body> tag [ ] src= attribute in <img> tag should spell image name with *exactly* the same spelling (including the same case) as the image file name (so your page will work with a UNIX-based web server) -- ALL LOWER CASE IS RECOMMENDED [ ] alt= attribute for <img> tags for accessibility [ ] width: and height: CSS for <img> tags for faster loading [ ] CSS centering, <div align="center"> </div> instead of <center> </center> [ ] <table> tag should have summary= attribute for accessibility [ ] </body> tag [ ] </html> tag [ ] generous use of spacing for readability [ ] Run HTML Tidy on your page to clean up your code! NOTE: This works for XHTML or HTML 4.01 ONLY. NOT FOR HTML5. ==== (Make a backup first: cp yourfile.html yourfile.html.orig) tidy -asxhtml -indent -modify -clean -file yourfile.errs yourfile.html *OR* tidy -asxhtml -i -m -c -f yourfile.errs yourfile.html *OR* tidy -f yourfile.errs -imc yourfile.html [ ] Check your page with the World Wide Web Consortium Validator services: http://validator.w3.org/ http://jigsaw.w3.org/css-validator/ NOTE: These work for HTML 4.01, XHTML, and HTML5, ==== but only for CSS up to 2.1. --- APPENDIX: Tidy command-line options ==================================== tidy [option...] [file...] [option...] [file...] Utility to clean up and pretty print HTML/XHTML/XML See http://tidy.sourceforge.net/ Options for HTML Tidy for Solaris released on 25 March 2009: File manipulation ----------------- -output <file>, -o write output to the specified <file> <file> -config <file> set configuration options from the specified <file> -file <file>, -f write errors and warnings to the specified <file> <file> -modify, -m modify the original input files Processing directives --------------------- -indent, -i indent element content -wrap <column>, -w wrap text at the specified <column>. 0 is assumed if <column> <column> is missing. When this option is omitted, the default of the configuration option "wrap" applies. -upper, -u force tags to upper case -clean, -c replace FONT, NOBR and CENTER tags by CSS -bare, -b strip out smart quotes and em dashes, etc. -numeric, -n output numeric rather than named entities -errors, -e show only errors and warnings -quiet, -q suppress nonessential output -omit omit optional end tags -xml specify the input is well formed XML -asxml, -asxhtml convert HTML to well formed XHTML -ashtml force XHTML to well formed HTML -access <level> do additional accessibility checks (<level> = 0, 1, 2, 3). 0 is assumed if <level> is missing. Character encodings ------------------- -raw output values above 127 without conversion to entities -ascii use ISO-8859-1 for input, US-ASCII for output -latin0 use ISO-8859-15 for input, US-ASCII for output -latin1 use ISO-8859-1 for both input and output -iso2022 use ISO-2022 for both input and output -utf8 use UTF-8 for both input and output -mac use MacRoman for input, US-ASCII for output -win1252 use Windows-1252 for input, US-ASCII for output -ibm858 use IBM-858 (CP850+Euro) for input, US-ASCII for output -utf16le use UTF-16LE for both input and output -utf16be use UTF-16BE for both input and output -utf16 use UTF-16 for both input and output -big5 use Big5 for both input and output -shiftjis use Shift_JIS for both input and output -language <lang> set the two-letter language code <lang> (for future use) Miscellaneous ------------- -version, -v show the version of Tidy -help, -h, -? list the command line options -xml-help list the command line options in XML format -help-config list all configuration options -xml-config list all configuration options in XML format -show-config list the current configuration settings Use --optionX valueX for any configuration option "optionX" with argument "valueX". For a list of the configuration options, use "-help-config" or refer to the man page. Input/Output default to stdin/stdout respectively. Single letter options apart from -f may be combined as in: tidy -f errs.txt -imu foo.html For further info on HTML see http://www.w3.org/MarkUp