Monty Monty - 4 years ago 64
CSS Question

Div sections in same line

I need to have the below two div to be remain in the same line(like tables) even after resizing the window to minimum size.

<div id="wrapper" style="">
<div id="div1" style="display:inline-block;">
<p>this is div one. this should remain in same line with div 2 even after resizing the window.</p>
</div>

<div id="div2" style="display:inline-block">
<p>this is div two. this should remain in same line with div 1 even after resizing the window.</p>
</div>
</div>

Answer Source

Use display:flex to wrapper, and it will do the job

<div id="wrapper" style="display:flex">
<div id="div1">

<p>this is div one. this should remain in  same line with div 2 even after resizing the window.</p>
</div>
<div id="div2">
<p>this is div two. this should remain in  same line with div 1 even after resizing the window.</p>
</div>
</div>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download