Guest User

Untitled

a guest
May 28th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <div id="header"></div>
  2.  
  3. <div id="main">
  4. <div id="navigation"></div>
  5. <div id="content"></div>
  6. </main div>
  7.  
  8. <div id="footer"></div>
  9.  
  10. #main {
  11. position: relative;
  12. }
  13.  
  14. #main #navigation {
  15. position: absolute;
  16. top: 0;
  17. left: 0;
  18. bottom: 0;
  19. width: 10em; /* or whatever */
  20. }
  21.  
  22. #main #content {
  23. margin: 0;
  24. margin-left: 10em; /* or whatever width you set for #navigation */
  25. }
  26.  
  27. html,body {
  28. height:100%;
  29. }
  30.  
  31. <main div>
  32. <content div>
  33. <navigation div></div>
  34. </div>
  35. </div>
  36.  
  37. $(function() {
  38. function unifyHeights() {
  39. var maxHeight = 0;
  40. $('#container').children('#navigation, #content').each(function() {
  41. var height = $(this).outerHeight();
  42. // alert(height);
  43. if ( height > maxHeight ) {
  44. maxHeight = height;
  45. }
  46. });
  47. $('#navigation, #content').css('height', maxHeight);
  48. }
  49. unifyHeights();
  50. });
  51.  
  52. <div id="container" class="clearfix" style="margin:0 auto;width:950px;background:white url(SOME_REPEATING_PATTERN.png) scroll repeat-y center top;">
  53. <div id="navigation" style="float:left;width:190px;padding-right:10px;">
  54. <!-- Navigation -->
  55. </div>
  56. <div id="content" style="float:left;width:750px;">
  57. <!-- Content -->
  58. </div>
  59. </div>
Add Comment
Please, Sign In to add comment