Forum Moderators: not2easy

Message Too Old, No Replies

Make div align exactly with the edge of the browser

         

rakan

7:12 pm on Sep 14, 2005 (gmt 0)

10+ Year Member



I have a div that I float to the left side of my webpage. I was wondering if anyone can tell me how to make a div align exactly with the edge of the browser. When I look at it in firefox I have a little bit of space between the edge of the browser and the div border. I want to get rid of it

CSS code:

div.menu{
background-color: #999999;
border: 1px solid #999999;
width:150px;
height:700px;
}

HTML code:

<html>

<head>
<title>whatever</title>
<link rel="stylesheet" type="text/css" href="main.css" title="Default">
</head>

<body>
<div class="menu">
This is a div
</div>
</body>

</html>

Span

7:17 pm on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is this part of your stylesheet:

body {
margin:0;
padding:0;
}

or, if you are using an XHTML dtd:


html,body {
margin:0;
padding:0;
}

rakan

10:09 pm on Sep 14, 2005 (gmt 0)

10+ Year Member



That did the trick, thanks a bunch.