Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Where (and what type) to put doctype?

Quote Reply
Where (and what type) to put doctype?
I've got a problem and potential solution, but welcome any advice from Links users.

I've had some problems displaying pages in IE7 - an example here:

http://www.ukprwire.com/...itioning_11895.shtml

In Safari and Opera this page displays fine, but in IE7 it is extra wiiiiiide, with unwanted white space in various places.

I've been told the problem may be fixed by adding a doctype, specifically this one:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

I added this to the 'detailed' template, but ALL the text on the page was then centred (centered) on IE7. Plus it was still wiiiiide!

Any ideas? Am I using the wrong doctype? Am I putting the doctype line in the wrong place?
Quote Reply
Re: [pepped] Where (and what type) to put doctype? In reply to
Hi,

You need to put it at the VERY first line of your pages.

i.e

Code:
<!DOCTYPE ....>

<html>
normal code etc here

However - it may still not sort your issues, if your page isn't XHTML valid (you can check here: http://validator.w3.org/ - and it will give you a list of the errors found on given pages).

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Where (and what type) to put doctype? In reply to
Thanks for that Andy (and will still need you to do some server moving for me some time soon, if you're still available!).

To put the doctype reference on the first line, am I putting it in the first line of the 'detailed' template?
Quote Reply
Re: [pepped] Where (and what type) to put doctype? In reply to
Hi,

Quote:
(and will still need you to do some server moving for me some time soon, if you're still available!).

Sure am :)

Quote:
To put the doctype reference on the first line, am I putting it in the first line of the 'detailed' template?

Yeah, that should be fine (although, ideally you will want it on all templates - to keep with XHTML standards). Once that tag is in place, you can validate the page - and see what kind of errors popup.

Normal things, are <p> not being closed - <img tags not having / at the end - i.e <img src="xxx" with="" height="" />, and non-closing <div> tags)

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!