PDA

View Full Version : DOCTYPE question



Gillberfer
12-08-2013, 02:56 PM
Yes I have a website which the link is http://hiscross.coffeecup.com/ . My website works great in all the browsers such as Opera , Firefox , Internet Explorer , CHrome , but in Safarai it falls apart just a little bit , and I found out that using doctype (<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">) , somehow makes it fall aprt , but if I delete doctype it works in all browsers , but falls apart in my html editor , and I mean totally falls apart , how can I use doctype , and it not fall apart in Safari ?

Here is an example of it without doctype : http://hiscross.coffeecup.com/index14.html

molendijk
12-08-2013, 03:42 PM
What exactly is the problem with Safari? There doesn't seem to be a problem with your site on my machine.

mlegg
12-08-2013, 05:09 PM
it looks fine in Safari for me too

edit: there are lots of HTML errors. Go check your code at http://validator.w3.org/

Gillberfer
12-09-2013, 03:32 AM
Oh that is funny for my main index.html page is off on my machine , but my index14.html works fine , check my index.html page to see how it works

ajfmrf
12-09-2013, 03:45 AM
hmm,I looked at both and they both work fine on my safari/machine/browser

not sure what you are talking about either

Deadweight
12-09-2013, 02:08 PM
whats the size of your screen?

Gillberfer
12-11-2013, 12:40 AM
Well here are screenshots of how my website looks on Safari , and I use windows 8.1 , and the size of my screen is 1920x1080.

Here is my website with doctype , in Safari.

5296

And here is my website in Safari without a doctype , which works well.

5297

Now here is my website in my html editor , without doctype.

5298

Do I need a doctype argument , or can I do witohout , and if so , how can I get to work in my html editor ?

Could the problem somehow be with windows 8.1 ?

Gillberfer
12-14-2013, 03:39 AM
Actually I solved my own problem through adding this code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

Gillberfer
12-14-2013, 03:39 AM
Thanks anyhow

jscheuer1
12-14-2013, 04:16 AM
Generally you should start with a standards invoking DOCTYPE, like:


<!DOCTYPE html>

as the first thing in the source code of the page(s). Test the page(s) in a current version modern browser like IE 10 or Chrome 31.

But because other approaches are workable, and depending upon the exact design things can vary, there is no hard and fast rule.