I've recently changed the doc type on a site i have to XHTML 1.0 strict. I'm now having validation errors. One is with border="0" in images tags, so i created a CSS style to set border to none, which works in firefox but not in IE.
Also the gaps i had between columns vanish when i put this doc type in. <hr> tags are not allowed to have width so i put in CSS for that and it doesn't seem to work.
The site is one i havn't updated for ages, was going to design a new layout, but before i do i want to get the current one to work with the doc type i have. Site is http://irealms.co.uk, any idea on what i need to change for it to validate?
The odd thing is, when i put the CSS in as a style attribute within the html tags, it works, but when i put it in the stylsheet and used a class within the tags it didn't.
It doesn't like the target attribute in a link, how do i get it to accept that? Also i have lots of these errors.
Error Line 29 column 26: document type does not allow element "hr" here; missing one of "object", "ins", "del", "map", "button" start-tag.
<hr style="width: 20px;" />
It doesn't like the target attribute in a link, how do i get it to accept that?
You can't. If you need the target attribute (why?) you'll have to go for a transitional doctype.
Error Line 29 column 26: document type does not allow element "hr" here; missing one of "object", "ins", "del", "map", "button" start-tag.
<hr style="width: 20px;" />
That's because you have a hr inside a p. I think that's the problem.
And about the other errors: the validator tells you exactly what's wrong. You have to get used to the language a bit. But the error reporting together with some checks at w3schools and the css specification or a good book should be enough to get rid of all errors.
Well, it's very simple. A paragraph must/should be surrounded by p tags. To group a section of a page use a div.
Both should work fine with margin and/or paddings. Although you'll have to read about the concept of "margin-collapsing", otherwise you'll get surprising results sometimes.
And don't forget you can target many elements without giving everything a seperate class or id (that's called "classitis" and "divitis").
Like: