SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Apr 2006
    Location
    London, United Kingdom
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help making site valid!

    Hey
    My programmer recently suggested that I transform our project www.webdesignpress.com into a valid document since our target are web designers. I have already tried to add a doctype etc, but when I do, the layout changes and disintegrates a little.

    For example here is the version with no doctype:
    www.webdesignpress.com

    Here is the version WITH the doctype
    www.webdesignpress.com/indexvalid.php

    You can find the CSS stylesheet here:
    www.webdesignpress.com/stylesheet.css

    How do I go about making their appearance identical? I would appreciate ANY help if possible in this, if you would like to kindly help me out personally in getting the layout valid please post here or PM, i would love it! And i'll also make you one of the staff if you please
    eFlair Design | Premium Design Services and Web Consultation

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By adding a DOCTYPE means that standards compliant browsers ( like Mozilla, IE5/Mac, and IE6/Win ) are now rendering your pages correctly. Browsers render pages without a DOCTYPE in quirks mode.

    To fix your pages you'll need to mess around with the css document. If you didnt write the css yourself I'd get the web dev extension for firefox and use outline current element tool to find the style names of all the bits and pieces that are out of place. Then go in to your css document and make changes accordingly.

    It might be a bit of a slog of a job but thats why you should always use doctypes at the start of your html documents.

    good luck!

  3. #3
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The doctype is the least of your worries. While you should have a good doctype at the end and thus it makes sense to start with it, adding one and fixing the CSS that breaks won't improve the quality of your page, and it won't be much more compliant. It's just wallpapering over the flaws.

    Almost everything in the markup is wrong. Sorry to be harsh but it really is a mess. Adding a doctype and making it pass validation won't change that. If you want it to be good then you need to rewrite the whole shebang.

    However if you just want to pass validation but don't want to change the CSS then you could strip off the URI from the doctype you're currently using.
    Simon Pieters

  4. #4
    SitePoint Addict
    Join Date
    Apr 2006
    Location
    London, United Kingdom
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    The doctype is the least of your worries. While you should have a good doctype at the end and thus it makes sense to start with it, adding one and fixing the CSS that breaks won't improve the quality of your page, and it won't be much more compliant. It's just wallpapering over the flaws.

    Almost everything in the markup is wrong. Sorry to be harsh but it really is a mess. Adding a doctype and making it pass validation won't change that. If you want it to be good then you need to rewrite the whole shebang.

    However if you just want to pass validation but don't want to change the CSS then you could strip off the URI from the doctype you're currently using.
    Thanks for your reply. But it really does not matter if it is quality code or not, and I am not prepared to write the whole thing again. Thank you for your kind suggestion but I still have yet to learn complete compliant code, or whatever you wish to call it. I just want to get the current 12 errors fixed and yield a "valid" result. Will someone be able to kindly help me out in how I would remove those errors step by step?

    Thanks for your help too elduderino

    For example ( http://validator.w3.org/check?uri=ww...indexvalid.php )

    I have many "topmargin" or "background or "leftmargin" errors on the document, how can I do about moving this into my css stylesheet so I can add the class to the cell with the same code but making it css valid? It would be great if someone could post an example.

    Find my css stylesheet here www.webdesignpress.com/stylesheet.css

    Sorry, I am not good at css
    Last edited by emkay; Feb 11, 2007 at 03:32.
    eFlair Design | Premium Design Services and Web Consultation

  5. #5
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, I would have to agree with the previous comment that starting again may be the best option.

    For example, the first error I'm getting is applying a background image to a TD with a class of "white2". This could be fixed by defining the style in the CSS by declaring:

    td.white2 {background: url(images/navtop_bg.gif) no-repeat}

    However, there is another TD further down the page, with the same class, but using a difference background image. A "class" should be applied to those elements that you want to style in the same manner i.e. having the same class applied to elements that you want to style differently shouldn't be done.

    In any event, the declaration above will fix the first error but you will need to remove the class "white2" from other elements for which you do not want that background image.

    The second error is applying a bordercolor to a TD in the HTML. This TD does not have a class or id so you will need to declare one before adding a "border" declaration in the CSS.

    The final error appears to be declaring a background for an entire table. Again, no class or id is specified and one will need to be added (unless you want the same background across all tables) prior to making a declaration in the CSS.

    These should fix your errors.

    Kind Regards

    Robin

  6. #6
    SitePoint Addict
    Join Date
    Apr 2006
    Location
    London, United Kingdom
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help Robin, will try it out
    eFlair Design | Premium Design Services and Web Consultation


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
  •