aznjay Posted September 9, 2008 Share Posted September 9, 2008 Problem has occured... When I resize my window the black box always is not in position...I need help i've been looking around because i don't want it to overlap from my layout. Click here: http://alltraxx.uni.cc/test.html Link to comment https://forums.phpfreaks.com/topic/123437-help-with-css-div/ Share on other sites More sharing options...
aznjay Posted September 9, 2008 Author Share Posted September 9, 2008 <html> <head> <link rel="stylesheet" type="text/css" href="contrib.css" /> <title> AllTraxx </title> </head> <div> <body background="alltraxxlayout.jpg"> <div id="nav"> lsoldjlehmcikhekfjmd </div> </body> </html> the CSS part: body { font-family: Verdana, Arial, Times new roman; font-size: 11px; color: #color; background-position: top center; width:900; height:2000; background-repeat: repeat-y; } #nav { position:relative; top:1em; left: 259px; float:left; height:250; width:145; background-color:#000; } Link to comment https://forums.phpfreaks.com/topic/123437-help-with-css-div/#findComment-637508 Share on other sites More sharing options...
aznjay Posted September 9, 2008 Author Share Posted September 9, 2008 bump bump bump!!!!! Link to comment https://forums.phpfreaks.com/topic/123437-help-with-css-div/#findComment-637523 Share on other sites More sharing options...
obsidian Posted September 9, 2008 Share Posted September 9, 2008 You are having this issue because you are using relative (fixed) positioning. By definition, this causes your element to be placed where you define, and it will not change when the browser is resized. Also, there is no point in using both a fixed placement and a float. If you describe what you are wanting to achieve, I'm sure we can help you. Try something like this in the meantime: HTML <body> <div id="wrapper"> <div id="nav">asdfasdfasdf</div> </div> </body> CSS #wrapper { width: 900px; margin: 15px auto; } #nav { float: left; height: 250px; width: 145px; background-color: #efefef; } Link to comment https://forums.phpfreaks.com/topic/123437-help-with-css-div/#findComment-637588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.