I have two divs under one parent div
, the parent div has 100% width:
<div id="parent">
<div class="left"></div>
<div class="right"></div>
</div>
The conditions are:
- I want two divs on the same line.
- The right div may or may not be present. When it is present, I want it to always be fixed on the right. However, the left div must be elastic - it's width depends on its content.
I have tried both float:left, and dispaly:inline-block but neither solution seems to work.
Any suggestion would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…