Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: None  |  size: 0.62 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to center using margin: auto while keeping non-centered divs from moving off page on browser resize
  2. #TopWrapper
  3. {
  4.     padding: 0px 200px;
  5. }
  6.  
  7.  
  8. #TopMiddleWrapper
  9. {
  10.     width: 826px;
  11.     margin: 0px auto;
  12. }
  13.        
  14. #TopWrapper {
  15.     width: 100%;
  16.     padding: 0px 200px;
  17.     float: left;
  18.     min-height: 450px;
  19.     height: auto !important;
  20.     height: 450px;
  21.     background: #7698b8 url(../Images/body.gif) repeat-x 0 0;
  22. }
  23.  
  24. #PhotoWrapper {
  25.     width: 916px;
  26.     margin: 0 auto;
  27. }
  28.  
  29. #TopMiddleWrapper {
  30.     width: 916px;
  31.     height: 100%;
  32.     margin-left: -124px;
  33.     min-height: 580px;
  34.     height: auto !important;
  35.     height: 580px;
  36. }