SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    should I remove w3.org link from my Doc Type?

    OK my SEO guy is saying we should remove some outside links from the site to improve our link juice.

    one if which he is recommened I remove is : http://www.w3.org/TR/html4/loose.dtd

    which resides in my doc type tag:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">


    I am wondering if this should really be advised?

    Thanks.
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.

  2. #2
    Design Your Site Team bronze trophy Erik J's Avatar
    Join Date
    May 2007
    Location
    Countryside, Sweden
    Posts
    3,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think You should keep the doctype url, or maybe switch to strict and then loose it.
    See Doctypes and their respective layout mode.
    Happy ADD/ADHD with Asperger's

  3. #3
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.

  4. #4
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Your SEO guy should be fired. There is only one correct DOCTYPE syntax for each version of HTML, which for HTML 4.01 transitional is
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    If you omit the URI, the DOCTYPE declaration will be invalid.

    Also, claiming that the DOCTYPE DTD URI counts as a link is rediculous. Aside from it not being a link, if Google actually considered it as part of the contents, the transitional DTD would be the single-most linked-to webpage on the Internet, meaning it should have a much better Pagerank than 8.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you remove the Formal System Identifier from the doctype declaration you'll run into all sorts of problems. Modern browsers will switch to rendering the document in 'quirks mode', which differs a lot between browsers. You'll have to test extensively in lots of different browser versions.

    Quote Originally Posted by C. Ankerstjerne View Post
    If you omit the URI, the DOCTYPE declaration will be invalid.
    That's not true. The FSI is optional, since it really says exactly the same thing as the FPI (the quoted string after PUBLIC).
    Birnam wood is come to Dunsinane

  6. #6
    Design Your Site Team bronze trophy Erik J's Avatar
    Join Date
    May 2007
    Location
    Countryside, Sweden
    Posts
    3,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The link I referred to was old, here is a more up to date Browser Mode List.
    Happy ADD/ADHD with Asperger's

  7. #7
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    That's not true. The FSI is optional, since it really says exactly the same thing as the FPI (the quoted string after PUBLIC).
    I had a look at the HTML 4.01 specification and DTD, but couldn't find any indication of it being optional.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,826
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Some browsers use its omission as a trigger to use quirks mode. Only by using a full doctype do you get standards mode.
    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="^$">

  9. #9
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    I had a look at the HTML 4.01 specification and DTD, but couldn't find any indication of it being optional.
    The doctype declaration is not an HTML construct; it's defined in SGML. The original idea was to use either an FPI (formal public identifier) or an FSI (formal system identifier). There's no point, from an SGML perspective, to use both, since they state the same thing. It wasn't until doctype sniffing became an issue that the doctype declaration began to matter at all for browsers.
    Birnam wood is come to Dunsinane

  10. #10
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    Your SEO guy should be fired.
    I have to agree. I've never heard anyone with any knowledge whatsoever make this kind of suggestion.

    Off Topic:

    Tommy, how's tricks, buddy?

  11. #11
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Just fine, mate!
    Birnam wood is come to Dunsinane

  12. #12
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    The doctype declaration is not an HTML construct; it's defined in SGML. The original idea was to use either an FPI (formal public identifier) or an FSI (formal system identifier). There's no point, from an SGML perspective, to use both, since they state the same thing. It wasn't until doctype sniffing became an issue that the doctype declaration began to matter at all for browsers.
    Fair enough. So, if the HTML 4.01 specifications are read strictly, it is required, even if it is essentially verbose.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  13. #13
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    Fair enough. So, if the HTML 4.01 specifications are read strictly, it is required, even if it is essentially verbose.
    No, the HTML 4.01 specification has nothing to do with it.

    The doctype declaration is an SGML construct meant to inform validating user agents which DTD to check against. Browsers use non-validating parsers and shouldn't really need a doctype declaration at all. A browser that supports HTML will honour <font> tags even if you declare the doctype to be HTML 4.01 strict.

    The only reason browsers look at doctype declarations – and why the FSI makes a difference – is that they use doctype sniffing to determine the rendering mode. That's got nothing to do with the HTML or CSS specifications. It's a way to achieve reasonable backward compliance with badly authored documents, while continuing to improve standards support for well-written documents.
    Birnam wood is come to Dunsinane

  14. #14
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,826
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Web browsers are actually misusing the doctype.

    Instead of actually reading the file that the doctype points to in order to see how they should render the page they have several sets of rendering rules built in and look at what you have specified as the doctype to decide which of those sets of rendering rules to use. In some browsers none of the choices come remotely close to the actual rules the doctype refers to. For example no browser uses the doctype to decide whether to render the page as HTML or XHTML.

    As the browsers are using the doctype for their own purpose rather than for what it is really intended for there is no reason why their requirements should match that which appears in any standards since the use they are making of it is not covered by the standards.
    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="^$">

  15. #15
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Instead of actually reading the file that the doctype points to in order to see how they should render the page they have several sets of rendering rules built in and look at what you have specified as the doctype to decide which of those sets of rendering rules to use.
    A DTD doesn't say anything about how to render a document. It only specifies the syntactical rules about which elements may contain which, and what attributes they can have.

    Quote Originally Posted by felgall View Post
    In some browsers none of the choices come remotely close to the actual rules the doctype refers to. For example no browser uses the doctype to decide whether to render the page as HTML or XHTML.
    It needs to know whether it's HTML or XHTML before it gets to the doctype declaration, since it will use different parsers. Not that browsers actually read DTDs, but XML DTDs – such as the ones for XHTML1 – have slightly different syntax than HTML DTDs.

    The type of content must be specified in the Content-Type HTTP header, so that the user agent has this information before it starts processing the response body.
    Birnam wood is come to Dunsinane

  16. #16
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Web browsers are actually misusing the doctype.
    I guess that's fair enough, at least for text/html but arguably also for XML.

    Quote Originally Posted by felgall View Post
    Instead of actually reading the file that the doctype points to in order to see how they should render the page
    s/render/parse/. The file that the doctype points to doesn't say anything about rendering.
    Quote Originally Posted by felgall View Post
    they have several sets of rendering rules built in and look at what you have specified as the doctype to decide which of those sets of rendering rules to use.
    Indeed. There are also some parsing and scripting differences in some browsers. (This is for text/html.)
    Quote Originally Posted by felgall View Post
    In some browsers none of the choices come remotely close to the actual rules the doctype refers to.
    Which rules did you have in mind?
    Quote Originally Posted by felgall View Post
    For example no browser uses the doctype to decide whether to render the page as HTML or XHTML.
    Nor should they. That's not what the doctype does. That's what the Content-Type does in combination with namespace declarations (if Content-Type is XML). The doctype just refers to an SGML DTD or an XML DTD with a bunch of declarations that affect the parser -- but doesn't switch to or from an XML parser or anything like that. (For XML, in browsers, the doctype only affects whether entities work or not. For text/html, in browsers, SGML rules aren't really followed at all.)

    Quote Originally Posted by felgall View Post
    As the browsers are using the doctype for their own purpose rather than for what it is really intended for there is no reason why their requirements should match that which appears in any standards since the use they are making of it is not covered by the standards.
    HTML5 defines doctype switching for text/html. However quirks mode isn't specced yet (other than a few quirks), but I might dive into that at some point.
    Simon Pieters


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
  •