I am facing an issue with arranging two divs under one parent div
. The parent div is set to have a width of 100%:
<div id="parent">
<div class="left"></div>
<div class="right"></div>
</div>
The specific conditions are as follows:
- I need both divs to be 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 side. However, the left div should be flexible and adjust its width based on its content.
I have experimented with both float:left and display:inline-block but have not found a satisfactory solution.
If you have any suggestions or ideas, they would be greatly appreciated.