SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    html validation confusion

    hii folks i m fixing someone website. i never got errors from website i make but this is like optimizing i got these error but i m confused e.g this error
    Code HTML4Strict:
    Line 342, Column 8: element "CENTER" undefined. Did you mean "center"?
     
    <center>
     
    
     
    You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
     
        * incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
        * by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
        * by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
    and
    Code HTML4Strict:
    Line 325, Column 30: required attribute "TYPE" not specified
     
    <SCRIPT LANGUAGE="JavaScript">
     
    
     
    The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
     
    Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
    what confuses me is this tag is correct but why the errors?

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2005
    Location
    Sparks, NV, USA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What document type are you using? XHTML strict? Transitional? Some of these document types do not allow those elements and attributes.

  3. #3
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    well i m working on a website some stupid guy created the page itself doesn't have document type it include a php file with has a normal DOCTYPE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  4. #4
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Huh I also didn't know Transitional couldn't deal with center tags. They were certainly deprecated in the Strict doctypes (and really, no reason not to use Strict). It's safer to just replace it if possible. Set a width on the element the center tag wraps around and auto-margin it center.

    The script tag needs to lose the language attribute. That got used for something else, and browsers never look there anyway. <script type="text/javascript"></script> unless you were using HTML5 (bleh).

  5. #5
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Well it works both ways, I was under the assumption that Transitional doctypes had been deprecated and only Strict versions of (x)HTML were still considered valid anymore (even though Transitional doctypes still validate). Though someone would need to verify if this is the case.

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The purpose of the transitional doctypes is for transitioning web pages to the standards.

    You can take a page that never had a doctype because it was written back in the 20th century and add a transitional doctype. With a few minor changes that page should then validate with that doctype which gets you a step closer to following the standards until you have time to take the other step and rewrite the page to follow the current standards properly. You can do that progressively while retaining the transitional doctype and once you are finally finished can then substitute the strict doctype.

    Of course for new pages you'd just start with the strict doctype since there is no non-standard code that you need to transition towards the standards in that case.

    As its name suggests a transitional doctype is intended to be used to transition a page of pretend HTML that works in some browsers into standard compliant HTML that works in all browsers.
    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="^$">


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
  •