Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
I think the problems are from scripts that I'm putting in. I'll have a look at it.
It seems stupid to me that opening tags within <script> tags don't get interpreted by the validator (they shouldn't), but that closing tags do. This means that if you write something like
document.write("<p>Here's a paragraph</p>'
(pretend those "<'s are <'s) it complains. Is there actually a reason for this?
I don't ever have a script element inside of another script element. I have commands that write script elements inside of a script element, which is perfectly fine.
Now the validator doesn't complain about the front page. It still complains about the other pages, but it looks like they're silly complaints, like "ampersands that you're hreffing to should be encoded". I don't think I've ever seen anybody encode their ampersands in a URL. In particular, Fog Creek doesn't do it when they include the style sheet, and I don't control that bit.
Works perfectly for me.
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.3a1pre) Gecko/20091229 Minefield/3.7a1pre
Is there actually a reason for this?
Scripts should be CDATA in XHTML. Update: the MathOverflow pages validate against HTML 4.01, which has a different parsing rule, see second answer in the link.
@Ilya: but the home page isn't XHTML.
Indeed, as my update tried to express, home page advertises itself as HTML 4.01, for which the spec says
the data begins immediately after the element start tag and ends at the first ETAGO ("</") delimiter followed by a name start character ([a-zA-Z]); note that this may not be the element's end tag. Authors should therefore escape "</" within the content.
Ok, I'm learning some things about html. For example, tables and lists cannot be in P tags, and the insides of blockquotes must be in P tags.
There are other times I don't know what it's talking about, like when it suggests I do what I did. The remaining error when it validates the homepage is
Line 1709, Column 210: Attribute "TARGET" is not a valid attribute. Did you mean "target"?
…/what-html-tags-are-allowed" target="_blank">basic HTML</a> and <a href="http
When validating the FAQ, it complains about my <h3> tags. What does it want me to do? I want those things to be H3s.
But <h3> appears in lots of places. For example, all the question titles on the home page are inside <h3> tags.
It's the combination of the <dt> tags and the <h3> tags. <h3>s, being headers, should occur outside the normal flow of text. <dt>s, being list elements, are within the normal flow of text.
Basically, both are trying to do the same job and so there's no point in having both. Why do you have the list elements? The headers are a sort of list anyway so there doesn't seem to be any reason to have them both.
Headers aren't depreciated, though I've heard that there's a proposal to make them nest automatically rather than having to specify the type each time. You just gotta use 'em right.
All but two of your errors on the FAQ are of this type. Either ditch the list (and make sure that the <a> tag is inside the <h3> (What about open problems?)) or put the "headers" inside a span and use CSS to control the formatting.
The homepage is invalid because the 'target' attribute is not allowed in HTML4.01 Strict. You're allowed it in Transitional, though. So either you can go to Transitional or you can simply remove the 'target' attribute. Does the 'target' do anything that you absolutely must have? It may be possible to replace its behaviour with a modicum of javascript.
When validating the questions, you need to be careful what you are comparing with! The javascript on a page changes what is there depending on who is logged on. I just tried looking at the source and couldn't find what it was talking about, but then I noticed that in the source was the line:
<input type="hidden" id="123-is-owned-by-current-user" value="true">
It's lucky that you chose one of my questions to validate! That line obviously wouldn't be there if anyone else looked at that question, so something is altering the contents depending on who's looking at the page.
That gave me the clue. When I do
~% wget http://mathoverflow.net/questions/123
and look at the resulting download then sure enough, on line 119 it says
<script>
var scores = document.getElementsByClassName("reputation-score");
if (scores.length == 0 || parseInt(scores[0].innerHTML.replace(",", "")) < 15) {
document.getElementById("banner-top").style.display = "none";
}
</script>
That 'script' should have a type.
The lesson is to not use the 'view source' facility of your web browser to see the source because that may well not be what's getting validated. Of course, that does mean that to truly validate your pages then you ought to send each possibility to the validator. The way to do that is to take copies of the HTML ("Save as" from your web browser) under the different circumstances and send them to the validator. Then you know that what the validator is validating is exactly what you think that it is validating.
By the way, well done for trying to get your pages to validate. It's very important to do.
Somehow I missed the answer by Andrew Stacey, who says the same things.
<h3> tags. What does it want me to do? I want those things to be H3s.
Those are block-level elements, you can't put them inside things like paragraph or list. Indeed, you shouldn't use definition list for sections. Instead, just write your text with
<DIV class="q-and-a">
<H3> header </H3>
<P> body </P>
<P> another paragraph </P>
<H3> header </H3>
<P> body </P>
<P> another paragraph </P>
</DIV>
and control the properties of H3 and P in the CSS. I guess if you just change tags DT -> H3 DD -> P you'll have the reasonable CSS; you might want to add P { margin-left: 1in; } or whatever you wanted from DD.
(You could also leave this a definition list and remove the sections; but you'll be breaking things for devices that would try to automatically create contents from headers. Again, what you have here is normal sections, so it should be called that).
It might make sense to take a look into official W3C (which is inside Bill Gates-sponsored building at MIT :) HTML 4.01 specification; it's quite fascinating reading. For example, this is said about P:
The P element represents a paragraph. It cannot contain block-level elements (including P itself).
I think <h3> is deprecated, aren't you supposed to use css for that stuff now?
Interesting misconception. No, noone would suggest that — HTML describes the content, CSS describes the formatting. Theoretically you could use DIVs with different classes instead of other HTML tags, but this will break the HTML model, and it's actively not recommended. You could use HTML5 SECTION tag (this is the one that automatically nests, as Andrew says)... but alas, for now it's actually recommended to use it together with H# (every browser knows HTML4, few know HTML5).
1 to 22 of 22