Forum Moderators: open
First off, I am trying to validate to HTML 4.01 Transitional.
it seems to have a problem with my stylesheet link
Line 16, column 57: document type does not allow element "LINK" here
<link href="/styles.css" rel="stylesheet" type="text/css">
... what on earth is wrong with this?! Do I need to have elements in <head> in a certain order?
Any help would be appreciated.
Cheers, Helen.
That's why I find this validation thing such a mystery, it seems to be suggesting errors where there aren't and not telling me the real problems!
It'll teach me not to pinch other people's badly written code though!
Are there any better ways?
I find it easier to use a separate validator on my desktop. In my case, that's CSE HTML Validator Pro from [htmlvalidator.com ].
It's much better than the basic validator included in editors, and easier to rerun as I make code corrections. (Also, in my experience, it gives more helpful error messages and suggestions than W3G, though that may vary according to the error.)
I have a couple of specific questions...
1) should I not have border="0" inside my image tags? If not I take it I should put it in the stylesheet?
2)I have a table with a name attribute. Is this now replaced with id and if so can I safely remove it? I notice that if I ever use Dreamweaver to code it puts both name and id. I think the reason the table is named at all is that it is used in a bit of javascript.
Cheers,
Helen.
should I not have border="0" inside my image tags?
I do not see why having the border=0 will hurt anything - personally I do not use it unless the image is a link. I code in XHTML and the border attrib still validates.
I have a table with a name attribute. Is this now replaced with id and if so can I safely remove it?
I guess that depends if the id is tied into the script you were referring to or perhaps it is a stylesheet selector - just guessing without seeing the code ;)
Here is some reading on it that may help [w3.org...]
Is the page not validating because of it?
I have just removed an end tag from one of my meta tags (apparently meta end tags are not allowed), and it is now not saying the stylesheet is wrong any more, plus a whole bunch of other errors like 'element <body> is not allowed here'...
Your problem lies before the link, body etc. tags. Sometimes the validator can't identify exactly where the error starts, so you have to work backwards. You say that you removed a meta tag? You may be missing a closing quote mark or angle bracket. Solve this one problem, and the others will be fixed, as the missing element is cascading down and producing many if not all the other validation errors. If you can't spot it (it's usually in the line immediately before the first error), then post your document from the DOCTYPE down to the opening <body> tag and we'll see if we can spot it.
As for
border="0" om image tags, it is fine in HTML 4.01 Transitional, although you can omit it if you are defining the border value with CSS. For the name attribute, I wouldn't remove it unles you're very sure it is not required by a script. It will also validate fine for HTML 4.01 Transitional.
I think that the table in question is named for a reason, I will have to have a look at the javascript and css in the page and work it out.
I think I am getting the hang of this whole validation thing. I assumed at first that the reported errors would be the exact thing they were pointing to. Now I know that this is not necessarily the case it might help.
Unfortunately it has stopped raining and I have to go and get on with some real work. No doubt I'll be back at this validation thing again sooner or later though.
Helen.
** dreams that one day she can legitimately put one of those cute little this-page-validates imgs on her pages **