...

View Full Version : <!doctype



ubik
12-15-2005, 04:02 AM
my friend has this site

you can find it at:
http://www.guyfactor.com/index2.html

it seems to be working perfectly in Internet Explorer, but when viewed in Firefox the tables are not showing up correct they are off the page and everything is misplaced. I have two screenshots here of the page in both browsers:



this is Internet Explorer, perfect.
http://xs59.xs.to/pics/05504/ie.gif


this is firefox, everything is misplaced
http://xs59.xs.to/pics/05504/ff.gif



i believe the page was designed in dreamweaver MX, I would appreciate any help/input on this subject, thanks.

Ranger56
12-15-2005, 05:14 AM
I just see 3 broken images

ronaldb66
12-15-2005, 08:22 AM
Amazing to see how much markup can be compiled to do absolutely... nothing! Table-icious...

oracleguy
12-15-2005, 07:03 PM
Yeah I just get a page with a bunch of broken images.

drhowarddrfine
12-15-2005, 10:03 PM
He's trying to use an html file (2.0 no less) as an image. This is a mess.

ubik
12-15-2005, 10:48 PM
i found a solution...
i removed this first line from the html source:



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


i guess cause browsers that dont support html 4.01 wont display it correctly? can someone verify why this happened?

_Aerospace_Eng_
12-15-2005, 11:31 PM
lol, Firefox if any other browser is the one that supports it correctly. IE on the other hand well it doesn't read colspans or rowspans correctly. Firefox however does this better than IE. The general rule of thumb is if your site looks okay in IE but not in a browser like Firefox then there is a good chance something is wrong with your coding. You should always code with a valid doctype (you know that line you removed). Code for a good browser like Firefox or Opera first then tweak for IE.

ubik
12-15-2005, 11:42 PM
what could possibly happen if you were to exclude the doctype from an html document? ive never included that in any of my sites and never had a problem in a variety of browsers?

oracleguy
12-16-2005, 12:40 AM
what could possibly happen if you were to exclude the doctype from an html document?

The browser just sort of has to guess at what version of HTML/XHTML to parse it as and it could lead to problems. Doctype's are a good thing on the whole though.

ubik
12-16-2005, 05:31 PM
ok.. I read somewhere that if the doctype changes your page you can compromise by using half a doctype, like this:



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


instead of:


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


so far its solved my problem, i found this information at http://diveintoaccessibility.org/day_6_choosing_a_doctype.html
but can someone verify this information to be correct?

gsnedders
12-16-2005, 06:17 PM
It's a malformed doctype, so the browser goes into quirks mode.

ubik
12-16-2005, 07:52 PM
i tried to read up on quirks modes but i couldnt follow much of it, i did however find this:



Both of the declarations in the following example specify conformance to the Transitional HTML4.0 DTD. The second declaration specifies the URL of the DTD. The first declaration does not. The second declaration switches on standards-compliant mode with Internet Explorer 6 or later. The first declaration does not.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">



"standards-compliant mode" ?

mark87
12-16-2005, 08:26 PM
Standards-compliant means it will interpret your HTML more like other browsers really, in laymans terms. You want IE in standards-compliant mode as opposed to quirks mode.

ubik
12-16-2005, 09:41 PM
so if its going to go into quirks mode with the doctype:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

should i just leave it out and put no doctype? afterall the page was designed and entirely generated in visual dreamweaver. perhaps it might need a different doctype?

mark87
12-16-2005, 10:00 PM
If you leave it out it will still be in quirks mode. You need to add a full Doctype ie.


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

ubik
12-16-2005, 10:27 PM
yeah that was the original doctype that dreamweaver generated for my friends page, if you go to the top on the first page, the first post i made i have 2 screen shots 1 in IE6 and the other in FF 1.0 of the same page with the doctype


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

but when i modify the page with no doctype or the one that views in quirks mode everything looks good.

oracleguy
12-17-2005, 12:42 AM
the other in FF 1.0

:eek: 1.0? You might wanna upgrade that, its a little behind the times now, the current version is 1.5

ubik
12-17-2005, 12:54 AM
lol that didnt even come out that long ago, besides i doubt that, that is the problem.

_Aerospace_Eng_
12-17-2005, 12:56 AM
FF1.5 does render some stuff a bit differently than its latest versions. I told you what the problem was, FF in standards compliant mode (with the doctype) is reading the colspans and rowspans correctly, IE is not. IE has always had a problem with colspans and rowspans.

ubik
12-17-2005, 01:18 AM
yeah i first thought it was colspan and rowspan too but i remember making many a website with photoshop using them and everything working perfectly in many browsres, ff, ie, netscape, konqueror... but after further looking into his source code i have now found the problem, i greatly appreciate all the time you all took into helping me try to find the problem, i actually learned about doctype, i will now change the doctype back to:


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


because that was not the problem at all, apparently firefox acts very strange when a ".htm" or ".html" extension is used where an image extension should go, my friend had accidently put ".htm" extensions to all the images.


He's trying to use an html file (2.0 no less) as an image. This is a mess.

i just barely understand this now after ive seen it, thanks everyone again sorry for all the trouble. good day.

_Aerospace_Eng_
12-17-2005, 01:23 AM
The errors that most of us missed, I guess its just not a common thing, I mean this is the first time I've actually heard of anyone putting .htm as the extension for their image files.

oracleguy
12-17-2005, 10:31 PM
The errors that most of us missed, I guess its just not a common thing, I mean this is the first time I've actually heard of anyone putting .htm as the extension for their image files.

Yeah... same here...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum