September 15, 200917 yr Hi Im having a problem validating my site. All the errors are emanating from the image mark up. It doesnt like the border, vspace, hspace, or align and claim it might be because of the doc type. This is my doctype: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> Does anyone know of a way out of this?
September 15, 200917 yr Basically it's telling you that the attributes in your image tag are depreciated under the current version of html you're using. border, vspace, hspace, or align should be handled via the css. From w3schools: XHTML 1.0 Strict This DTD contains all HTML elements and attributes, but does not include presentational or deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML. What's the exact error given by the validator though?
September 15, 200917 yr Hi, Doctypes are not my speciality, but it seems like you've got two at the top, one for XML and one for XHTML, I'm not sure sure if you need the first line, but then I'm not too good with doctypes, maybe someone else will know better. EDIT: forget that bocaj has answered the Q I'm better with CSS so if you could show how your images are positioned etc I can prob help out with that.
September 15, 200917 yr could you post a link to the site, or if not the entire html and css of your site that way we can have a look at it and see where it is going wrong
September 15, 200917 yr It definitely does cause validation erors to have <?xml version="1.0" encoding="utf-8"?> or anything above the doctype. Whether that's causing errors with images is hard to say, but delete the XML code. That code seems to originate from coding Microsoft programs like Word and Excel where a doctype is not provided. Coding tables with border="..." align="..." is deprecated and there are CSS ways of coding as an alternative like border: 1px solid black; and I think vspace and hspace are so old that they do cause validation errors. Try a transitional doctype if you still get errors after removing the XML code.
September 15, 200917 yr I would of thought it did too but I tested with one of my sites and all I got was a warning about using Direct Input mode. Normally <?xml version="1.0" encoding="utf-8"?> is used when you are using xml rather than html or xhtml, it can be used with an xhtml doctype but should only be used if using xml. Best way to set character encoding is to this meta in the head as an alternative if you are just coding in xhtml: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> But I really don't think the errors are to do with the doctype itself (other than a warning) and more to do with the coding for the site itself, so looking at the code will help as it will let us know how they are coding what needs to be edited and also if an alternative doctype would be better for the site
Create an account or sign in to comment