css auto width floating issue
Please check out this image
<body>
<div clas开发者_StackOverflow中文版s="main>
<div class="left">blah blah </div>
<div class="right">blah blah </div>
<div style="clear:both"></div>
</div>
</body>
CSS part:
.main{min-width:1200px}
.left{width:400px ; height:auto ; float:left }
.right{width:auto ; height:auto ;float:left }
I hope friends, you have got an idea from the image. Please help me.
I am dynamically inserting data into right
div and when its width exceeds 800px
, it comes down the left div. But instead of that I want a horizontal scrollbar to view the content. One solution may be, removing float:left
from right div. But still it causes problem.
on floated elements, height:auto means the height of the content (the default for floated elements). try with height:100%
精彩评论