SyncViews Posted December 9, 2007 Share Posted December 9, 2007 Why is the "right:170px" ignored on the div#body? Style sheet contents div#body { background-color: #000000; border-style: solid; border-color: #009999; border-width: 1px; color: #CCCCCC; text-align: center; position: relative; left: 160px; right: 170px; } div#nav { float: left; background-color: #000033; border-style: solid; border-color: #009999; border-width: 2px; color: #DDDDDD; text-align: center; width: 150px; } html page <!--bunch of header stuff--> <div id="nav"> <!--Verticle nav bar--> </div> <div id="body"> <!--lots of text--> </div> <!--footer--> Quote Link to comment Share on other sites More sharing options...
themistral Posted December 9, 2007 Share Posted December 9, 2007 Hiya! Not sure why...is there anything set to the left or right of these divs? Have you tried changing the position to absolute instead of relative? Quote Link to comment Share on other sites More sharing options...
SyncViews Posted December 9, 2007 Author Share Posted December 9, 2007 Not sure how I'm meant to do absolute here. I don't know how "high" the body block will be because it is a php page and gets that from a data base and if I don't do abosulote with the footer as well it seems to put the footer "ontop" of everything else:( anyway heres there entire page source. All the formatting is done by CSS and the includes don't contain anything that should effect the positioning (eg main_nav.php only uses the "span.nav_..." stuff) <?php include ('./globals.php'); $page_name = 'Index'; $page_type = 1; include ('./main_header.php');//includes <html>, <head> and <body> //connects to data base ($con); ?> <div id="nav"> <?php include ("./main_nav.php");?> </div> <div id="body"> <?php $result = mysql_query("SELECT Text_1 FROM data WHERE ID=1"); if (!$result) { exit (mysql_error()); } $data = mysql_fetch_array($result); echo $data['Text_1']; ?> </div> <div id="footer"> <?php include ('./main_footer.php');?> </div> </body> </html> and the CSS body { background-color: #0000CC; padding: 0 } /*-------------------------*/ /*===========NAV===========*/ /*-------------------------*/ div#nav { float: left; background-color: #000033; border-style: solid; border-color: #009999; border-width: 1px; color: #CCCCCC; text-align: center; width: 150px; } span.nav_header { text-decoration: underline; font-weight: bold; font-size: large } span.nav_home { font-weight: bold; } span.nav_result { } /*--------------------------*/ /*===========BODY===========*/ /*--------------------------*/ div#body { background-color: #000000; border-style: solid; border-color: #009999; border-width: 1px; color: #CCCCCC; text-align: center; position: relative; left: 160px; right: 170px; } /*----------------------------*/ /*===========HEADER===========*/ /*----------------------------*/ h1.header_title { text-align: center; text-decoration: underline; font-weight: bold } /*----------------------------*/ /*===========FOOTER===========*/ /*----------------------------*/ div#footer { background-color: #000000; border-style: solid; border-color: #0011AA; border-width: 1px; color: #EEEEEE; text-align: center; width: 400px; } Quote Link to comment Share on other sites More sharing options...
bronzemonkey Posted December 9, 2007 Share Posted December 9, 2007 Use {margin:0 170px 0 160px;} Quote Link to comment Share on other sites More sharing options...
themistral Posted December 9, 2007 Share Posted December 9, 2007 I thought Left, Right, Top, Bottom were valid values if you were trying to get fluidity... Quote Link to comment Share on other sites More sharing options...
SyncViews Posted December 9, 2007 Author Share Posted December 9, 2007 Well margin worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.