I usually define my HTML documents as XHTML 1.0 Strict. However, recently, for a project, I needed to style content images as having a padding of five pixels with a white background and a black border of 1 pixel. This worked fine in Firefox, but Internet Explorer did not show the padding. After some searching, I found out, that I had to put the doctype on the very first line of the document and it worked! However, now the W3 markup validator concludes that the document is invalid, because the XML header could not be found on the first row.
So, the first set up was (IE fails to display the padding surrounding the image and the document is valid):
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml version="1.0" encoding="iso-8859-1"?>Thanks in advance and kind regards,
Jeroen