2

I have a div content that has a fix width size. Inside of the div i put other div's - float:left;

what i need :

the content div to make overflow:auto (horizontal) if the divs that are inside have more width than the content div width.

<div class="div_26" style="width:10px;height:10px;overflow:auto; ">

<div style="float:left;width:7px;height:8px;">
<div style="float:left;width:7px;height:8px;"> 
 <div style="float:left;width:7px;height:8px;">

</div>

1 Answer 1

4

Try:

<div class="div_26" style="width:10px;height:10px;overflow:auto; ">
    <div style="width:21px;">
        <div style="float:left;width:7px;height:8px;"></div>
        <div style="float:left;width:7px;height:8px;"> </div>
        <div style="float:left;width:7px;height:8px;"></div>
        <div style="clear:both"></div>
    </div>
</div>
Sign up to request clarification or add additional context in comments.

6 Comments

i try it but it make overflow vertical not horizontal
You also need to add all closing div tags.. completely missed that
ok. it works but i don't know what is the value of the div that you create <div style="width:21px;"> i need somthinng like width:auto;
do you mean the divs that need to float are dynamic? in that case jnust set the div width:1000000px;
yes. the content div is like a shelf and inside this one i put products (div whit specific width and height). if i put more products on that the content div weight support i need the horizotal overflow. i dont't know what is the width size of all product to set that width:21px to a specific size. it must be automatically
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.