What doctype to use with IE7

With the arrival of  Internet Explorer 7 web devlopers will need to carefully consider the doctypes and css hacks they previously used to distinguish between standards browsers and the IE.

There is an good introduction to doctypes here:  Document Type Declaration - Wikipedia

For designers/css coders read: http://www.alistapart.com/articles/doctype

A listapart lists the following as correct doctypes:

HTML 4.01 Strict, Transitional, Frameset

  • < . !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  • < . !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  • < . !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
  • XHTML 1.0 Strict, Transitional, Frameset

  • < . !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  • < . !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

XHTML 1.1 DTD

< . !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">Here’s an explanation of when to use what

http://www.htmlhelp.com/tools/validator/doctype.htmlThe key differences between transitional and strict are in HTML declarations are:

  • Depreciated elements are not allowed.  These include “font” “center” etc. 
  • Link targets are not allowed, so you can can’t validate if you want to use HTML popups.  This is a killer for me, as Javascript popups can’t be followed by search engines!
  • Frames are not allowed.  No arguement from me here…

The other important difference is how the CSS is rendered.  Most importantly which “box model” IE will use!  If you set strict, then IE6 will render the correct box model, but IE5 and IE5.5 won’t, so then you need to use different Conditional test/hacks in the CSS. Agh!

 See http://css.maxdesign.com.au/listamatic/about-boxmodel.htm for great explanation of what to use.

In summary:

  • No doctype will set both IE5 and IE6 “quirks mode”
  • HTML transitional - no “URL” - again IE5 and IE 6 “quirks mode” (traditionally good for simplifying hacks)
  • HTML transitional - full URL -  IE5 “quirks mode”, IE 6 “standards mode”

More at http://www.webmasterworld.com/forum83/7345.htm

Finally http://www.quirksmode.org/css/quirksmode.html site explains further:

In strict mode ad image is an inline element, which means that some space should be reserved for possible descender characters like g, j, or q. Of course an image doesn’t have descender characters, so the space was never used, but it still was there. The solution is to explicitly declare images block level elements: img {display: block}. Nonetheless browser vendors introduced “almost strict mode”. This was defined as strict mode, but with images continuing to be blocks, and not inline elements.

And the full kahoona onn technical rendering with charts on what gets rendered and full list of doctypes see http://hsivonen.iki.fi/doctype/

IE6 has another bug [now fixed in IE7].  This allow validation of HTML, but still allows use of the old IE5 box model in IE6.  You have to include an XML prolog right at the start of the document: < . ?xml version="1.0" encoding="iso-8859-1"?> [remove dot]

So moving forward:

      
Comments are off for this post       

Flash CMS

Flash CMS systems

A quick blog on it here

http://www.flash99good.com/?p=92

Incubate Sydney company
http://www.incubate.com.au/

Flashblocks

http://www.flashblocks.com/index.php?option=com_weblinks&catid=68&Itemid=4

No comments

Bitmap fonts for Flash

http://fontsforflash.com/

Using non-alias fonts in Flash

No comments

Why we use Wordpress for our blog

We’ve just upgraded to Wordpress 2.0.

While web2growCMS (based on modX application framework) had a great Newslisting module, which we use on the web2grow.com website, Wordpress had specialised blogging features that make it a better tool for informal blogging (such as Pingback).

No comments

 

Theme fSpring, design by Fredrik Fahlstad Proudly powered by WordPress Categories: CSS Web Design,Code bits

Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code: