SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation CSS and XHTML Fix

    Any idea how to fix this site? It's really messsed up. Originally I had no doc type. Just <html>

    Now when I changed to XHTML Transitional everythings seriously just screwed

    Can someone help me fix the code a bit?

    Also how do you do mouseover and out correctly in xhtml?

    Thanks.

    http://gameinfiniti.com/

  2. #2
    SitePoint Evangelist
    Join Date
    Sep 2006
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WOW.... where to begin.... sigh...

    I think the first step is for you to take a look at the w3c validator. This page has over 300 errors....

    You've got alot of inline javascript (i guess?) embeded in onmousover="" tags..... I'm not familiar with this method, so I can't really elaborate on it.

    You need to start on this validator and start cleaning your code up. After you do a few passes cleaning up all the small misc stuff post again and I'm sure many will be happy to take a look.

    http://validator.w3.org/check?uri=ht...Inline&group=0

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol yea i think i should change to 4.01 html transitional? Also how to change from table to css div solution? I'm not really sure because this is just a template i started with.

  4. #4
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    No way, Strict is what you want.

    If you were learning how to do a sport, would you want a coach who just encourages you all the time and never tells you what you're doing wrong, or do you want the coach who will tell you YER DOIN IT WRONG every time you screw up until you do it right?

    Well, I want the second coach, even if he seems like an @ss, because I will get better from it.

    Strict doctype lets the validator tell you ALL your mistakes. Transitional just hides them to make you feel better about your code.

    If the page looks awful with the addition of a doctype, it means the page was specifically coded to look Most Jawsome in IE5 back in those heady days of Geocities, grunge bands, and the pre-dot-bomb bubble. Like, when animated gifs and flaming letters and a little "Best Viewed In Internet Explorer" badges were the rage.

    Maybe you want to totally ditch the template and get a modern template. Those exist. It might me a LOT easier to deal with.

    Edit:

    example of a site which has not-bad css-based templates for free: http://www.freewebsitetemplates.com/ except of course I would recommend changing their Transitional sissy doctypes to a manly Strict : )

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol but it looks good can u help me convert it to strict plz?... html strict or xhtml?

  6. #6
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    HTML, XHTML... doesn't matter, depends on whether you like closing /> tags on empty elements like <link> and <img>

    I personally use HTML4. It doesn't need the Javascript hidden as CDATA. It works on all browsers. XHTML, when you use it to work on ALL browsers, is just mangled HTML with a cool-looking X in the front. As you can see, the SitePoint people really liked that X, it's Xtreme. But, up to you. Strict is more important.

    Again, instead of spending a lot of time changing the table to divs, I'd take a quick look around for something that looks mostly what you have except it was coded in this century.

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,593
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    html 4.01 strict is the current standard that all modern browsers follow so that's the one to use unless you have a really good reason to use a different one. The transitional standards are for web pages originally written in HTML 3.2 that have yet to be fully converted.

    The doctype should be the first thing you write for the page since it will affect everything else.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thx i will use xhtml strict

  9. #9
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Well, really just about all your JavaScript should be linked externally so you don't get conflicts and bloat. At the moment you seem to be using HTML4.01 with a mismatching DTD. You may want to try TidyGUI to speed-up the conversion and highlight some of those errors.


Tags for this Thread

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
  •