Subscribe to the RSS Feed »

Follow me on Twitter »



Find Programming Jobs

Image padding and quirks mode in Internet Explorer

I hadn't come across this one yet, but there's a first time for everything! For the life of me, I couldn't figure out why Internet Explorer was ignoring the padding I had set on an image. I reverse engineered everything down to the last detail, but still couldn't identify the cause. Then I found this forum post on Dev Shed, which explains that a comment inserted before the DOCTYPE will cause IE to go into quirks mode, and in quirks mode IE doesn't apply padding to images. I didn't have a comment before the DOCTYPE, but I did have a PHP include. I moved that below the DOCTYPE declaration, and presto! Problem solved.

 

Share this: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Sphinn
  • StumbleUpon
  • TwitThis
  • del.icio.us
  • bodytext
  • Technorati
  • Pownce
  • description

Leave a Reply