Hello Everybody,
I am writing a web page that relies heavily upon CSS for page element positioning. When viewed in IE6 my code looks really good, however it looks like garbage in NS6. I have obviously overlooked some compatibility issues. If anybody can point out the code that is causing the compatibility issues it will be greatly appreciated. My code looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<html xmlns=" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<title>Registration Page</title>
</head>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
body
{
background-color: #D5FFFF;
background-repeat: repeat;
}
form
{
background-image: url("bg1.gif");
background-repeat: repeat;
position: absolute;
height: 400px;
margin-left: 50px;
margin-top: 0px;
width: 450px;
z-index: 0;
}
#firstName
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 50px;
width: 150px;
z-index: 1;
}
#lastName
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 100px;
width: 150px;
z-index: 1;
}
#emailAddress
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 150px;
width: 150px;
z-index: 1;
}
#newsletterBoolean
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 310px;
margin-top: 200px;
width: 50px;
z-index: 1;
}
#postCode
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 310px;
margin-top: 250px;
width: 50px;
z-index: 1;
}
#register
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 160px;
margin-top: 300px;
width: 100px;
z-index: 1;
}
#labelforfirstName
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 50px;
width: 150px;
z-index: 1;
}
#labelforlastName
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 100px;
width: 150px;
z-index: 1;
}
#labelforemailAddress
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 150px;
width: 150px;
z-index: 1;
}
#labelfornewsletterBoolean
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 200px;
width: 200px;
z-index: 1;
}
#labelforPostCode
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 250px;
width: 200px;
z-index: 1;
}
#legendforTitle
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 120px;
margin-top: 5px;
width: 200px;
z-index: 2;
}
#legendforfirstName
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 10px;
margin-left: 210px;
margin-top: 30px;
width: 100px;
z-index: 2;
}
#legendforlastName
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 80px;
width: 200px;
z-index: 2;
}
#legendforemailAddress
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 130px;
width: 200px;
z-index: 2;
}
#legendfornewsletterBoolean
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 20px;
margin-left: 280px;
margin-top: 180px;
width: 200px;
z-index: 2;
}
#legendforpostCode
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 20px;
margin-left: 280px;
margin-top: 230px;
width: 200px;
z-index: 2;
}
.required_indicator
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 120px;
margin-top: 320px;
width: 200px;
z-index: 2;
}
/*]]>*/-->
</style>
<body>
<form name="registration_form" method="post" action="">
<fieldset>
<legend id="legendforTitle">Registration Details</legend>
<legend id="legendforfirstName">Required Field</legend>
<label id="labelforfirstName" for="firstName">First name: ¤</label>
<input id="firstName" type="text" />
<legend id="legendforlastName">Optional Field</legend>
<label id="labelforlastName" for="lastName">Last name: </label>
<input id="lastName" type="text" />
<legend id="legendforemailAddress">Required Field</legend>
<label id="labelforemailAddress" for="emailAddress">Email: ¤</label>
<input id="emailAddress" type="text" />
<legend id="legendfornewsletterBoolean">Optional Field</legend>
<label id="labelfornewsletterBoolean" for="newsletterBoolean">Send me the newsletter!</label>
<input id="newsletterBoolean" type="checkbox" value="checkbox" />
<legend id="legendforpostCode">Optional Field</legend>
<label id="labelforpostCode" for="postCode">Your Postcode (4 digits)</label>
<input id="postCode" type="text" />
<input id="register" type="submit" />
</fieldset>
</form>
<br />
<span class="required_indicator">¤ indicates a required field.</span>
</body>
</html>
Thanks for your help.
Regards
David
I am writing a web page that relies heavily upon CSS for page element positioning. When viewed in IE6 my code looks really good, however it looks like garbage in NS6. I have obviously overlooked some compatibility issues. If anybody can point out the code that is causing the compatibility issues it will be greatly appreciated. My code looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<html xmlns=" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<title>Registration Page</title>
</head>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
body
{
background-color: #D5FFFF;
background-repeat: repeat;
}
form
{
background-image: url("bg1.gif");
background-repeat: repeat;
position: absolute;
height: 400px;
margin-left: 50px;
margin-top: 0px;
width: 450px;
z-index: 0;
}
#firstName
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 50px;
width: 150px;
z-index: 1;
}
#lastName
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 100px;
width: 150px;
z-index: 1;
}
#emailAddress
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 150px;
width: 150px;
z-index: 1;
}
#newsletterBoolean
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 310px;
margin-top: 200px;
width: 50px;
z-index: 1;
}
#postCode
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 310px;
margin-top: 250px;
width: 50px;
z-index: 1;
}
#register
{
border: 2px ridge teal;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 160px;
margin-top: 300px;
width: 100px;
z-index: 1;
}
#labelforfirstName
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 50px;
width: 150px;
z-index: 1;
}
#labelforlastName
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 100px;
width: 150px;
z-index: 1;
}
#labelforemailAddress
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 150px;
width: 150px;
z-index: 1;
}
#labelfornewsletterBoolean
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 200px;
width: 200px;
z-index: 1;
}
#labelforPostCode
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 50px;
margin-top: 250px;
width: 200px;
z-index: 1;
}
#legendforTitle
{
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 120px;
margin-top: 5px;
width: 200px;
z-index: 2;
}
#legendforfirstName
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 10px;
margin-left: 210px;
margin-top: 30px;
width: 100px;
z-index: 2;
}
#legendforlastName
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 80px;
width: 200px;
z-index: 2;
}
#legendforemailAddress
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 20px;
margin-left: 210px;
margin-top: 130px;
width: 200px;
z-index: 2;
}
#legendfornewsletterBoolean
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 20px;
margin-left: 280px;
margin-top: 180px;
width: 200px;
z-index: 2;
}
#legendforpostCode
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #404000;
position: absolute;
height: 20px;
margin-left: 280px;
margin-top: 230px;
width: 200px;
z-index: 2;
}
.required_indicator
{
font-family: 'Administer Book', Serif;
font-size: 15px;
font-style: italic;
color: #009B9B;
position: absolute;
height: 20px;
margin-left: 120px;
margin-top: 320px;
width: 200px;
z-index: 2;
}
/*]]>*/-->
</style>
<body>
<form name="registration_form" method="post" action="">
<fieldset>
<legend id="legendforTitle">Registration Details</legend>
<legend id="legendforfirstName">Required Field</legend>
<label id="labelforfirstName" for="firstName">First name: ¤</label>
<input id="firstName" type="text" />
<legend id="legendforlastName">Optional Field</legend>
<label id="labelforlastName" for="lastName">Last name: </label>
<input id="lastName" type="text" />
<legend id="legendforemailAddress">Required Field</legend>
<label id="labelforemailAddress" for="emailAddress">Email: ¤</label>
<input id="emailAddress" type="text" />
<legend id="legendfornewsletterBoolean">Optional Field</legend>
<label id="labelfornewsletterBoolean" for="newsletterBoolean">Send me the newsletter!</label>
<input id="newsletterBoolean" type="checkbox" value="checkbox" />
<legend id="legendforpostCode">Optional Field</legend>
<label id="labelforpostCode" for="postCode">Your Postcode (4 digits)</label>
<input id="postCode" type="text" />
<input id="register" type="submit" />
</fieldset>
</form>
<br />
<span class="required_indicator">¤ indicates a required field.</span>
</body>
</html>
Thanks for your help.
Regards
David