• Home
  • Engineering
  • Business
  • Travel

DeMar.is

DeMar.is

Monthly Archives: January 2006

W3C Compliance Attained!

24 Tuesday Jan 2006

Posted by Justin DeMaris in Engineering

≈ Leave a comment

Well the other day Steve made the mistake of reminding me of the existence of the W3C Markup Validator. I think the gist of the conversation involved complaining about it, but the fact that my code wasn’t W3C compliant got on my nerves. So in between compiling LFS 6.2 and BLFS 6.1, I took a night off to learn what parts of my code weren’t being W3C compliant and fix them.

I didn’t get it all done that night, but I did learn a few things. Now tonight, I am proud to announce that fugitivethought’s front page is completely W3C standard compliant. And if they aren’t picky, I don’t know who is!!

A few quick tips for anyone who wants to use the validator to check out their site:

  • If you’re using PHP, be sure that the top line of the PHP file that loads is <? header(“Content-type: text/html; charset=utf-8”); ?> – this informs the browser what type of text format to expect the PHP output to be in. Of course if you are using a different character set, change the utf-8 to whatever it is, but chances are it’s probably utf-8
  • The most recent version of HTML, which seems to be what I’ve been writing in anyway, is HTML 4.01. So right after the header for the text encoding, include the line: <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”&gt; which tells the browser to expect 4.01 code. I used transitional because I still like such tags as <center> and <font>. Somewhere down the road I’ll break down and convert it all over to 4.01 Strict. But if you put transitional in the DOCTYPE, at least the browser knows what to expect.
  • Be sure to close all tags in the proper place. For instance, W3C doesn’t like unordered lists to be embedded inside paragraph tags. So whenever you are using an unordered list, end the paragraph tag, start the unordered list, end the unordered list, end the paragraph tag. This is true for a lot of other types of tags too.
  • USE THE SHOW SOURCE CHECKBOX! – Especially if you are working on PHP code. This helps immensely because it shows you the code as it sees it and includes the line numbers it references!

Alright, I hope this blog post doesn’t break the W3C compliancy, because that would just make me mad……

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • April 2015
  • March 2015
  • July 2012
  • June 2012
  • January 2012
  • December 2011
  • November 2011
  • March 2010
  • January 2009
  • July 2008
  • March 2008
  • February 2008
  • January 2008
  • August 2007
  • June 2007
  • May 2007
  • April 2007
  • February 2007
  • January 2007
  • November 2006
  • June 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • July 2005
  • June 2005

Categories

  • Business
  • Engineering
  • Travel
  • Uncategorized

Meta

  • Register
  • Log in

Blog at WordPress.com.

  • Follow Following
    • DeMar.is
    • Already have a WordPress.com account? Log in now.
    • DeMar.is
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar