I am trying to make a div that contains other floating divs in order to adjust its width so that adding more floating divs (dynamically using jQuery) will only expand the div in its width, preventing the floating divs from creating a new line. Therefore, I want to fix this problem, so that each div with the grid-row class expands only in width, and therefore I can scroll using overflow: scroll for the parent grid div. I searched a lot for answers and it seems like this is a known issue. However, no answer solved my problem.
I am currently doing this:
<div id="grid_container"> <div id="grid"> <div class="grid_row"> <div class="module" id="experience"> Experience </div> <div class="header"> Google </div> <div class="header"> Microsoft </div> </div> <div class="grid_row"> </div> </div> </div>
CSS:
body { } #grid_container { margin: 50px auto; width: 500px; height: 500px; padding: 10px; border: black solid 1px; } #grid { overflow:scroll; height: 100%; } .grid_row { clear: both; height: 50px; } .module, .header{ padding: 10px; float: left; border: gray solid 1px; }
html css
Sam
source share