div problem
- Started
- Last post
- 6 Responses
- Atkinson
I have two divs, menu and main. Menu is down the left and main is 750 px wide, to the right of menu. When I resize a browser window 'main' drops below 'menu'. I did know how to fix this [main should just scroll left-right]. How do I fix it?
#side_menu {
margin-left: 15px;
margin-top: 15px;
padding: 0px;
width: 150px;
float:left;
}
#main{margin-left: 10px;
margin-top: 15px;
margin-right: 0px;
margin-bottom: 0px;
padding: 0px;
width: 750px;
height: 100%;
float:left;
vertical-align: top;
overflow: auto;}
- ********0
check yr float, maybe one left and one right?
- Atkinson0
nah, does the same, just takes a few px longer to happen!
- Atkinson0
ah got it, shouldnt have a float on main?
- jonatne0
You need a container div with an explicit width
- bulletfactory0
maybe a containing div with a min-width attribute?
- 7point340
#container_div {
position: relative;
}
[inside of container_div]#side_menu {
position: absolute;
top: 0;
left:0;
}#main {
position: absolute;
top:0;
left 150px;
}