Javascript – Code review guidelines for CSS, JS and HTML

code-reviewscsshtmljavascript

I have been asked to create guidelines for review CSS, JS and HTML. I know there are coding guidelines for JS but I don't know any about HTML and CSS. To review JS I will certainly follow those guidelines and mention them. But what about CSS and HTML? Apart from logical errors and indentation issues, are there any specific things I need to check when I review markup and or CSS?

Best Answer

Some things to look for:

  • Is structured information identified using the appropriate HTML tags? H1-H6 for headings, UL/OL and LI for lists, etc?
  • Are no legacy HTML tags (<b>, <i>, <center>, <font>) used?
  • Does the site use the least amount of markup possible?
  • Is style information externalized to CSS files?
  • Is all Javascript externalized? including event handlers?
  • Do CSS class names refer to the function in the page (img-caption), and not form (bold-red) or content (pink-elephant)?
  • Are images in the appropriate format (PNG or JPEG, depending on the type)?
  • Have minimized versions of Javascript libraries been used?
  • Optionally, have all locally-developed Javascript and CSS files been minimized?
  • Does the HTML / CSS validate?
  • Has YSlow (or similar) been used to check/optimize performance?
  • (mostly) [SEO] Is the site accessible with Javascript turned off?
  • [SEO] Is the most relevant content found at the top of the HTML?