PerlMonks is currently using DTD HTML 4.0 Transitional for its DOCTYPE. With that in mind, a few things in the <head> could be changed to make the red circle with an X in it appear less often.

The current code is...

<head> <title>Perl Monks Discussion</title> <!-- Theme 0: Web safe blue PerlMonks Theme --> <link rel="stylesheet" href="/css/common.css" type="text/css" /> <link rel="stylesheet" href="?node_id=204962" type="text/css" /> <!-- No CSS Link in User Settings --> <style type="text/css"> .inlinecode {color:#600;} .codeblock {color:#006;font-size:8pt;} </style> <link rel="icon" href="/favicon.ico" /> </head>

Valid code for DOCTYPE...

<head> <title>Perl Monks Discussion</title> <!-- Theme 0: Web safe blue PerlMonks Theme --> <link rel="stylesheet" href="/css/common.css" type="text/css"> <link rel="stylesheet" href="?node_id=204962" type="text/css"> <!-- No CSS Link in User Settings --> <style type="text/css"> .inlinecode {color:#600;} .codeblock {color:#006;font-size:8pt;} </style> <link rel="icon" href="/favicon.ico"> </head>

The difference is subtle, the / at the end of the <link> and <img> tags do not belong in DTD HTML 4.0 Transitional.

As an aside, can I please have the styles back in my profile. When I wrote it ages ago when styles were still allowed, it looked good, now it doesn't. So, pretty please with cookies!

Have a nice day!
Lady Aleena

Replies are listed 'Best First'.
Re: For valid HTML
by rowdog (Curate) on Apr 04, 2010 at 22:52 UTC

    I don't see any real issue with using a trailing slash, especially with a doctype of 4.0 transitional that tells us to expect a jumble of tag soup. Maybe we ought to move up to 1999 and use 4.01 since it supersedes 4.0.

    Just for kicks, I ran the w3c validator against the front page and got 115 Errors and 199 warnings. Most of the problems were because the validator gets confused about how to parse the many trailing slashes and a few were cruft from HTML 3.2. The actual warning (NOT error) for the link tag was

    The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.
    FWIW, a simple <br /> validates as HTML 4.01 Transitional as a snippet in the validator.

    At one point it looked like the web was (theoretically) headed towards XHTML but now it looks more like HTML 5. The WHATWG wiki article on HTML vs. XHTML says

    Void elements only have a start tag; end tags must not be specified for void elements, and it is impossible for them to contain any content. A trailing slash may optionally be inserted at the end of the element's tag, immediately before the closing greater-than sign.
    Either way, the trailing slash will probably be at least optional.

    I do feel your pain though as I'm also quite pedantic about the HTML I generate.

      Either way, the trailing slash will probably be at least optional.

      At most optional. The slash being treated as optional is the best possible result, not the worst. The possible outcomes range from "incorrectly used and ignored" to "incorrectly used and gives an error". (Browsers don't support the correct use.) The OP's browser is apparently somewhere in the middle of that range since it ignores the error for rendering purposes while discretely notifying the user of the error ("red circle with an X in it").

      especially with a doctype of 4.0 transitional that tells us to expect a jumble of tag soup

      It sounds like you're saying transitional documents don't have to be well-formed, and that's not true.

        Actually, <BR/> would be the start of a SHORTTAG construct (ending with the next slash). It's not supported by most mainstream browser, but it's a valid SGML construct, and the HTML DTD doesn't prohibit it (unfortunally). See SGML features with limited support.
        The slash being treated as optional is the best possible result, not the worst.

        That's a matter of opinion, I'm sure some people would rather see XHTML win out over HTML 5.

        It sounds like you're saying transitional documents don't have to be well-formed, and that's not true.

        Oh really? The front page of perlmonks renders just fine in my browser but it's not even close to a well-formed document. To clarify, I believe there are two ends of the spectrum: what works and what is correct. Many websites work just fine with broken HTML. Many times, the HTML is intentionally broken to support browsers that don't support standards. I really don't mean to criticize perlmonks here, it works and that's all I ask, but the site doesn't exactly validate.

        Myself, I strive to write correct code in any language and to comply with any applicable standards to the best of my ability.

Re: For valid HTML
by jdporter (Paladin) on Apr 09, 2010 at 13:36 UTC
    can I please have the styles back in my profile. When I wrote it ages ago when styles were still allowed

    I don't understand what you mean by this. Styles are still "allowed": you can add custom CSS in your Display Settings. Are you saying that the website has deleted your custom CSS?

    What is the sound of Windows? Is it not the sound of a wall upon which people have smashed their heads... all the way through?

      One can no longer put CSS in one's own home node to control how the node looks to other people. Note that CSS can be used to remove or replace basic navigation and/or basic user information (the reporting of which is an important part of the function of home nodes).

      Given that several people have already demonstrated their willingness to use CSS to interfere with basic functions of their home node, I don't see the privilege to include CSS being restored. If we had a simple way to filter CSS so that simple styling could be allowed without allowing disruptive uses of CSS, that might make a difference.

      - tye        

        ah, tye, you interpreted her "profile" as homenode. That makes sense. If that's the case, then she must be talking about stuff she did a long time ago indeed. I'd say there's a certain "statute of limitations" on such changes; her opportunity to complain has long since passed.

        What is the sound of Windows? Is it not the sound of a wall upon which people have smashed their heads... all the way through?