I am trying to bring two divs in one line horizontally. On some basic search, display:inline
should be able to do it. But see the below code:
<div style="display:inline; ">
<div style="line-height:0pt; border:1px solid red" align="left" >
<span style="white-space:pre-wrap; font:Bold 10pt Helvetica; color:rgb(0,0,0);">STATE EMPLOYEES' PPO PLAN</span>
</div>
</div>
<div style="display:inline ">
<div style="line-height:0pt;border:1px solid red" align="left" >
<span style="white-space:pre-wrap; font:normal 9pt Helvetica; color:rgb(0,0,0);">Administrative Services Provided by:</span>
</div>
</div>
It's keeping divs in two separate lines, whereas display:inline-block
gives the desired behavior:
<div style="display:inline-block; ">
<div style="line-height:0pt; border:1px solid red" align="left" >
<span style="white-space:pre-wrap; font:Bold 10pt Helvetica; color:rgb(0,0,0);">STATE EMPLOYEES' PPO PLAN</span>
</div>
</div>
<div style="display:inline-block">
<div style="line-height:0pt;border:1px solid red" align="left" >
<span style="white-space:pre-wrap; font:normal 9pt Helvetica; color:rgb(0,0,0);">Administrative Services Provided by:</span>
</div>
</div>
But the problem i am having with display:inline-block
is that it gives too much padding, so when i expect two lines to come closer together, they come at a lot of gap in between which is not acceptable.. display:inline seems the way to go but it just isn't working. Kindly explain this behavior and what can be done to make it right..