chreo
08-07-2006, 02:25 PM
IE can't read this with <?xml version="1.0" encoding="utf-8"?> at the top.
<!--[if IE]> <link rel="stylesheet" href="css/text1_IE.css" type="text/css" /> <![endif]-->
</head>If I take away the xml-tag, it works fine, and the document validates the same. This is probably a very silly question, but it bothers me, and I would really like to know!:)
Question 2: Can xml-browsers still read the page without that line?
Question 3: I have always had charset=ISO-8859-1
Is charset=utf-8 better or necessary?
Background:
I have a document that validates as XHTML 1.0 Strict, and functions in both Fx and IE, but I read somewhere that since most people use IE, and IE does not support XHTML, we might as well stick to HTML. I had not experienced any problems, so I checked for doctypes on W3C and found that I had not put the complete doctype in my document. I switched mine for theirs, and THEN the page worked so-so in IE. Here is the code:
<?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">
<head>
<title>Links page</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="css/text1.css" rel="stylesheet" type="text/css" />
<!--[if IE]> <link rel="stylesheet" href="css/text1_IE.css" type="text/css" /> <![endif]-->
</head>
<!--[if IE]> <link rel="stylesheet" href="css/text1_IE.css" type="text/css" /> <![endif]-->
</head>If I take away the xml-tag, it works fine, and the document validates the same. This is probably a very silly question, but it bothers me, and I would really like to know!:)
Question 2: Can xml-browsers still read the page without that line?
Question 3: I have always had charset=ISO-8859-1
Is charset=utf-8 better or necessary?
Background:
I have a document that validates as XHTML 1.0 Strict, and functions in both Fx and IE, but I read somewhere that since most people use IE, and IE does not support XHTML, we might as well stick to HTML. I had not experienced any problems, so I checked for doctypes on W3C and found that I had not put the complete doctype in my document. I switched mine for theirs, and THEN the page worked so-so in IE. Here is the code:
<?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">
<head>
<title>Links page</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="css/text1.css" rel="stylesheet" type="text/css" />
<!--[if IE]> <link rel="stylesheet" href="css/text1_IE.css" type="text/css" /> <![endif]-->
</head>