Im tried many times to do this, is very usefoul in many situations but seem not possible:
- Have 2 divs into same div container, in short 2 columns, div container width stay fixed.
- Every div appear like inline-block, so it adjust based to inner content, so if inner content is nothing, width is zero, if inner is 100px width will be 100px. This is the normal inline-block.
- The 2 divs must stay always in same row, no break line.
- If content of one or both two divs is overflow, it will be hidden and div stay always into the width of container.
Im able to make 1-2-3 but I stop on 4.
This is the code:
<div class="container">
<div class="column">Lorem ipsum dolor sit amet</div>
<div class="column">Lorem ipsum dolor sit amet</div>
</div>
CSS
.container{
display: table;
overflow: hidden;
}
.column {
display: table-cell;
}
Similar thing can be done by inline-block but both 2 ways have same problem: width of div with inner content overflow not stay into container width but stay full content width
Is bit difficoult to explain, hope someone understand. This is a screenshot of my project, and my problem: http://expirebox.com/download/39f9acff53e75830b1714a653b11e0d0.html
Thank you