Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want your <code>float:left</code> divs to grow horizontally and avoid vertical scroll, you will need to wrap your <code>divs</code> inside a bigger div with fixed horizontal width i.e.</p> <p>you can come close to what you want to achieve through these steps:</p> <ul> <li><p>make your container 1 with a very high width. you can do this by statically specifying a width or calculating width of inner divs and assigning it to it through javascript</p></li> <li><p>Now, your inner divs i.e. 2,3,4 are going to be of <code>width:auto</code> and <code>float:left</code>, (4 can be <code>float:right</code> as well) </p></li> <li>Now again, your inner divs are going to have divs which you want to be horizontally aligned,i.e. b,c, d,e,f in container 3: you want them to be horizontally aligned, hence you will have to give 3 a static width, and these b,c,d,e,f a <code>width:auto</code></li> <li><p>Now since you don't know what width you should give to your 2,3 and 4, you will have to calculate the width of individual divs inside each of them through javascript and assign the sum to them. i.e.</p> <p>width(3) = width(b) + width(c) + width(d) + width(e) + 30px = (a little extra thn actual sum of content divs)</p></li> </ul> <p>so, the basic point is, for horizontal alignment and no vertical scroll, the parent container should have fixed width.</p> <p>now see this <a href="http://jsfiddle.net/manishmishra256/Nxbvh/" rel="nofollow noreferrer">fiddle</a>, I've already provided static width to the containers. you have get that through a javascript code.</p> <p>also, have a look at overflow property. go through <a href="https://stackoverflow.com/questions/258372/css-div-element-how-to-show-horizontal-scroll-bars-only">this</a> and <a href="https://stackoverflow.com/questions/443700/div-with-horizontal-scrolling-only">this</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload