Too few hours in the day //Jafoca.com

Cramming as much into my life as possible. Tech product reviews, work, etc…
  • rss
  • Home
  • A Semester in Australia
    • Diving in Australia
      • Polarus Dive Trip
  • About
  • Contact

HTML Doctype declaration - Can really mess you up!

jafoca | August 20, 2008

So yesterday we discovered a bug in the Blue Sky Sessions website.  I think that I probably introduced it when I was fiddling with getting our contact form looking pretty last week, although I have no idea how as the contact form is not presented with the portfolio where the bug occurred.  The bug consisted of the entire layout being shifted to the left hand side of the screen from its normal centered position, quite embarrassing.  It only happened in IE, and was only on one of our pages.

Anyhow - I took to looking at the code and found that structurally the template was exactly the same as the other pages, so it should have been centered.  I really could not find this bug!  Getting frustrated, I asked Barry (my boss / coworker) to have a look at it.  After deleting most of the page he noticed that I was missing an HTML DOCTYPE declaration.  Yuck.htmlsvg1-263x300 HTML Doctype declaration - Can really mess you up!

He put this in and of course (silly me, I should have thought of that…) it worked.  The doctype tells the browser how to parse the HTML code, I did not realize that it had actual importance to interpretation so I was not too attentive to it in the past.

An example doctype declaration is:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

So anyway, if you are having goofy HTML bugs then be sure to check out your doctype.  An excellent reference for anything HTML is w3schools.

Share/Save/Bookmark

Categories
work
Tags
html, web design, work
Comments rss
Comments rss
Trackback
Trackback

« Testing iphone wordpress China fakes Olympics - again and again and… »

Leave a comment

You must be logged in to post a comment

Navigation

  • Other Reviews
  • Random Stuff
  • Tech
    • Deals
    • Hardware
    • Random
    • Review
    • Software
  • Thoughts
  • Uncategorized
  • work

Gallery

rad_diving 275.jpg rad_diving 035.jpg

Tag Cloud

apple browser china chrome computer computer game computers condo database dell DRM energy fake firefox games google green hosting housing html iphone java jsp laptop linux mac maps mashup michigan microsoft office olympics photo politics programming review software spore test tv vampire weather web design web host work

My Del.icio.us

  • 100 Free High-Quality XHTML/CSS Templates | Developer's Toolbox | Smashing Magazine 2008/12/02
    free templates high quality
  • SEO tools – Exactfactor - Track and Manage google search rankings 2008/12/01
    Good for seo, weekly reports of search positioning.
  • Free CSS templates - tutorial blog 2008/11/16
  • 31 Professional WordPress Themes | Webmaster-Source 2008/11/10
    Professional wordpress themes
  • WordPress › Support » flowplayer plugin 2008/10/30
    Flowplayer - a nice video player
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox