Problem with an absolute div

Thread Solved

Join Date: Feb 2009
Posts: 38
Reputation: thacravedawg is an unknown quantity at this point 
Solved Threads: 0
thacravedawg thacravedawg is offline Offline
Light Poster

Problem with an absolute div

 
0
  #1
Oct 26th, 2009
Okay so I'm building a site with a bit of an unusual and complex layout. It has a static header div of a fixed height. A body div of a variable height that must be positioned absolutely for overlapping. And I need there to be a footer directly below the absolute div. Here is the basic layout of the css/html

HTML and CSS Syntax (Toggle Plain Text)
  1. <style type="text/css">
  2. #page_wrapper
  3. {
  4. width:800px;
  5. margin-left:auto;
  6. margin-right:auto;
  7. }
  8. #header_wrapper
  9. {
  10. width:800px;
  11. height:140px;
  12. }
  13. #header
  14. {
  15. width:800px;
  16. height:140px;
  17. }
  18.  
  19. #body_wrapper
  20. {
  21. width:800px;
  22. position:absolute;
  23. display:block;
  24. }
  25. .header_transition
  26. {
  27. width:800px;
  28. height:45px;
  29. position:absolute;
  30. left:0px;
  31. top:0px;
  32. background-image:url('img/green_bar_cut.png');
  33. z-index:-1;
  34. }
  35. #body_contents_wrapper
  36. {
  37. width:800px;
  38. position:absolute;
  39. top:13px;
  40. left:0px;
  41. z-index:1;
  42. }
  43. #body_contents
  44. {
  45. width:800px;
  46. position:absolute;
  47. top:32px;
  48. left:0px;
  49. background-image:url('img/body_bg.png');
  50. z-index:2;
  51. }
  52. #content_wrapper
  53. {
  54. width:575px;
  55. float:left;
  56. margin-top:-32px;
  57. }
  58. #content
  59. {
  60. width:510px;
  61. margin-left:30px;
  62. margin-right:35px;
  63. }
  64. .content
  65. {
  66. width:510px;
  67. }
  68. #footer_wrapper
  69. {
  70. width:800px;
  71. height:105px;
  72. clear:both;
  73. }
  74. </style>
  75.  
  76. <html>
  77. <div id="page_wrapper">
  78. <div id="page_header">
  79. <div id="header_wrapper">
  80. <div id="header">
  81. </div>
  82. </div>
  83. </div>
  84. <div id="body_wrapper">
  85. <div class="header_transition"></div>
  86. <div id="body_contents_wrapper">
  87. <div id="body_contents">
  88. <div id="content_wrapper">
  89. <div id="content">
  90. <div class="content">
  91. <--
  92. Start Content Here
  93. -->
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. <div id="footer_wrapper">
  101. <--
  102. This container is now showing up at the top edge of div id body_contents...
  103. -->
  104. </div>
  105. </div>
  106. </html>

Basically, I have everything in the top portion of the document working properly. I just can't get my footer to work below my absolutely positioned element. I have tried wrapping div id body_contents in another div that is positioned statically and no marbles. Please help me get my footer to display in the right place.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 38
Reputation: thacravedawg is an unknown quantity at this point 
Solved Threads: 0
thacravedawg thacravedawg is offline Offline
Light Poster
 
0
  #2
Oct 26th, 2009
I ended up having to get cute and use background-images in relative divs to get my needed end result. If anyone does know of a way to put a div of any position below a absolutely positioned div of relative size, it would be cool to see it.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 490 | Replies: 1
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC