Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: DOCTYPE problem

  1. #1
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Exclamation DOCTYPE problem

    Hi,

    I love the feeling when W3.org's validator says that "YOUR DOCUMENT IS 100% VALID!". Well... I ran into a problem. I coded my entire website without the <!DOCTYPE> before the <html> tag. Ok I near-finish the site( it is written in php) and I scan it throgh the validator. I get out all the problems, then add in a DOCTYPE HTML 4.1 Transitonal. Boom, its valid! Yay-Me. Not Quite. I go to the document in my browser to post the HTML 4.1 Valid logo, and EVERYTHING is messed up. The page looks like a tornado went through it. I toolk off the DOCTYPE to see if it was the problem. The page went back to its normal self. HELP! I want a valid Document and keep it the same way I programed it. HELP!!!!!!
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    This is why you should use a Strict DOCTYPE from the start. You've written your page in a way that depends on various browser bugs that only appear in quirks mode. When the page is given a DOCTYPE, the browser stops producing these bugs.

    There's not much for it but to rewrite the buggy parts of your stylesheets. If those are particularly prominent, it may be easier to rewrite the whole thing from scratch.

    If it looks bad in Standards mode, chances are it will look bad in browsers other than the one in which you were developing, as well. Try it in at least IE6, IE7, Firefox, Opera and Safari.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    OK, I re-validated the document in HTML 4.1 Strict and only 14 errors, mainly saying that you can do the same thing in css, No big, but even then, will the document go back to normal? Only one thing that I dont know how to do: I have a background image and a background color to fill the parts the image doesn't. It only allows one. The only way to do it is to make the color part of the image for like 700px, so no matter what resoultion, there will be no white space. Also there is no TARGET attribute, how do I get links to open in a new window, without javascript?
    Last edited by fileserverdirect; 08-10-2007 at 10:15 PM. Reason: Added Problem
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I re-validated the document in HTML 4.1 Strict and only 14 errors, mainly saying that you can do the same thing in css, No big
    As big as any of the other errors.
    but even then, will the document go back to normal?
    No. You didn't read my post properly. Your page is written so that it depends on various browser bugs, so it will only look "right" in quirks mode on one browser on the 29th of February under the light of a full blue moon after eating the small glowing mushrooms that sprout 71.8m underground at Stonehenge after sacrificing a baby unicorn with crossed eyes and doing an ancient Mayan dance in five dimensions. Fixing it isn't as simple as just making it conform to a given DTD, you also have to rewrite it so it looks how you want it to under that DTD. Then, and only then, will your page be accessible to the majority of browsers.
    Only one thing that I dont know how to do: I have a background image and a background color to fill the parts the image doesn't. It only allows one. The only way to do it is to make the color part of the image for like 700px, so no matter what resoultion, there will be no white space.
    Layer another element over the top to hold the background image.
    Also there is no TARGET attribute, how do I get links to open in a new window, without javascript?
    You don't. Frames and new windows are both deprecated in modern versions of HTML. You can use Javascript if you really must:
    Code:
    <a href="somepage.html" onclick="open(this.href);">
    ... but it's not recommended.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jul 2007
    Location
    California
    Posts
    177
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey View Post
    it will only look "right" in quirks mode on one browser on the 29th of February under the light of a full blue moon after eating the small glowing mushrooms that sprout 71.8m underground at Stonehenge after sacrificing a baby unicorn with crossed eyes and doing an ancient Mayan dance in five dimensions.
    Odds are slim of that happening...shame that he didn't say "it will only look 'wrong' in ...." Then the odds would be very good that it would never look wrong.

    There's one thing about that statement that makes me think it may not be totally true... there's no way a mushroom could grow that deep underground. Without that tidbit of info my trained eye could have believed the rest...

  6. #6
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    Thanks for the posts you guys, but your forgeting a main problem in re-writing the site. A its written in php that reliys on various language\common function documents, and it took over 3 months to write, I mean come on:
    ...so it will only look "right" in quirks mode on one browser on the 29th of February under the light of a full blue moon after eating the small glowing mushrooms that sprout 71.8m underground at Stonehenge after sacrificing a baby unicorn with crossed eyes and doing an ancient Mayan dance in five dimensions.
    It wasn't that messed up. P.S. One of the things that was all messed up was one of D.D.'s scripts, so maybe DD should re-write some of it's script's ah?
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    A its written in php that reliys on various language\common function documents, and it took over 3 months to write
    If you invested that much time into writing your site, you did of course use a templating engine such as Smarty to separate your design and logic, thus making a rewrite of the frontend much easier.
    It wasn't that messed up.
    I was exaggerating just a little, I thought I made that fairly plain
    P.S. One of the things that was all messed up was one of D.D.'s scripts, so maybe DD should re-write some of it's script's ah?
    Most certainly. I'll be the first to complain about the poor quality of not just some but most of DD's scripts.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    If you invested that much time into writing your site, you did of course use a templating engine such as Smarty to separate your design and logic, thus making a rewrite of the frontend much easier.
    I have no idea what you are talking about, but what I do know is that I solved the problem. I fixed all the errors in 4.1 Strict made it look just the smae way as it did before, transefernd all <font> tags to css and, Its 100% Valid, and the way that I like it to :-)
    I'll be the first to complain about the poor quality of not just some but most of DD's scripts.
    Note that over half dont work in IE5.5 Mac anyways(Mac's are sooooo over-rated). I have IE7 on an xp SP2 so then again... Well never mind.
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I fixed all the errors in 4.1 Strict made it look just the smae way as it did before, transefernd all <font> tags to css and, Its 100&#37; Valid, and the way that I like it to :-)
    Good
    Note that over half dont work in IE5.5 Mac anyways(Mac's are sooooo over-rated). I have IE7 on an xp SP2 so then again... Well never mind.
    It's not the Mac's fault. IE5 is a ruddy terrible browser -- the Mac version is actually less buggy than the Windows version.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    Quote Originally Posted by fileserverdirect
    I fixed all the errors in 4.1 Strict made it look just the smae way as it did before, transefernd all <font> tags to css and, Its 100% Valid, and the way that I like it to :-)
    Well, I kinda lied, There is only one problem that I cannot seam to fix... I have an Information bar at the top of the page, under my logo and page title. I have a background image with a fade in and out on etheir sides (about 770px in between) and I have a drop-down-menu in the Information bar. I continued that color in the divison next to it. It says "please log in" or when your logged in "Hello, username. Go to your Control Pannel" etc. Before the DOCTYPE it streched all the length of table (770px) so it matched to the background. It does not strech all of the way. I think there is a problem in the main table. I must have nested too many and lost track. Is there such thing as a table debugger? But then why did it work before the DOCTYPE?
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •