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

Untitled

By: a guest on Jun 25th, 2012  |  syntax: None  |  size: 0.61 KB  |  hits: 19  |  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. Do divs expand vertically to fit their children divs?
  2. <div class='headerWrapper'>
  3.     <div class='header'>
  4.         <img..... height=100>
  5.     </div>
  6. </div>
  7.        
  8. <style type="text/css">
  9.     .headerWrapper {overflow: auto;}
  10.     .header {overflow: auto;}
  11. </stlye>
  12. <div class='headerWrapper'>
  13.     <div class='header'>
  14.         <img..... height=100>
  15.     </div>
  16. </div>
  17.        
  18. <style type="text/css">
  19.     .clearfix:after {visibility: hidden;display: block;font-size: 0;content: " ";clear: both;height: 0;}
  20. </stlye>
  21. <div class='headerWrapper clearfix'>
  22.     <div class='header clearfix'>
  23.         <img..... height=100>
  24.     </div>
  25. </div>