I'm having a few woes with Netscape 6 and CSS. I want to centre a <div> horizontally in the centre of the screen but it won't budge from the left hand side.
I want to do this using CSS and not by adding align="center" attributes because this will be an XHTML page.
How can this <div> be centred on the screen in NS6? Also, how can the <div> be made to fill the whole height of the screen like it does in IE?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
<!--
body {
height: 95%;
width: 95%;
text-align: center;
padding: 0px;
background-color: #cccccc;
}
div.centerdiv {
text-align: center;
}
div.content {
background-color: #ffffff;
width: 600px;
height: 98%;
text-align: left;
padding: 6px;
border: solid 1px #003399;
}
//-->
</style>
</head>
<body>
<div class="centerdiv">
<div class="content">
text goes here.
</div>
<div>
</body>
</html>
I want to do this using CSS and not by adding align="center" attributes because this will be an XHTML page.
How can this <div> be centred on the screen in NS6? Also, how can the <div> be made to fill the whole height of the screen like it does in IE?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
<!--
body {
height: 95%;
width: 95%;
text-align: center;
padding: 0px;
background-color: #cccccc;
}
div.centerdiv {
text-align: center;
}
div.content {
background-color: #ffffff;
width: 600px;
height: 98%;
text-align: left;
padding: 6px;
border: solid 1px #003399;
}
//-->
</style>
</head>
<body>
<div class="centerdiv">
<div class="content">
text goes here.
</div>
<div>
</body>
</html>
Comment