Forum Moderators: not2easy
I'm using the newest version of Netscape, version 8.1.3, that I downloaded from the Netscape website yesterday.
<html>
<head>
<title>div using Netscape browser</title>
<style>
table {cell-padding: 0px;}
p {font-size: 30pt;}
</style>
</head>
<body>
<table width=100%>
<tr>
<td>
<div id="div_one" name="div_one" style="position: absolute; top: 0px; left: 100px;">
<p>This is a div</p>
</div>
</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title></title>
<style type="text/css">
#header {
border: #000 solid 1px;
}
html, body {
padding: 0px;
}
</style>
</head>
<body>
<div id="header"></div></body>
</html>
You may have to set margin to 0px for the html, body too as some browsers refer to the body's padding as margin.
- John
Secondly, you need the right doctype [webmasterworld.com] when doing anything serious with CSS, see option 1 or 3 from the linked page.
Finally, yes there's a padding problem - there is padding and/or margin on paragraphs, for example. Also, why the table if you are using absolute positioning, as that simply takes the
div out of the context of the table anyway? Try this for starters (untested, red border added for clarity):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>div using Netscape browser</title>
<style [b]type="text/css"[/b]>
#div_one {position:absolute;top:0;left:100px;[b]border:1px solid red;[/b]}
p {font-size: 30pt;}
</style>
</head>
<body>
<div id="div_one">
<p>This paragraph is within the div</p>
</div>
</body>
</html>