I have a absolute position div that I set on the below of another div. When I maximize or minimize browser press ctrl +/- then my absolute position div don’t stay his original position. Please can someone point out what I may be doing wrong here? Many thanks. Here is my code:
<html>
<head>
<title>Test Page</title>
<style type="text/css">
body
{
margin: 0px;
padding: 0px;
}
#header
{
width: 980px;
height:80px;
background: #006666;
margin: 0 auto;
}
#content
{
color: white;
padding-top: 30px;
margin-left: 200px;
}
#menu
{
position: absolute;
top:50px;
left:222px;
width: 100px;
height: 20px;
background: red;
}
</style>
</head>
<body>
<div id="header">
<div id="content">Uttara.hr</div>
<div id="menu"></div>
</div>
</body>
</html>
I guess what you need is the red
divbelow your text, so you need to giveposition: relative;to the parent div so that absolute positioned div doesn’t flow out in the wildDemo
(Note: you can now adjust the div the way you want)
CSS