Search code examples
csshtmlalignment

div align creating new line


I am using below code

​<div align="left">
Line 1
</div>
<div align="right">
Line 2
</div>

I was expecting output as Line 1 at left side and Line2 at right side on same line, however I get output in two line. How can I get this in one line?

jsfiddle


Solution

  • <div style="float: left">Line 1</div>
    <div style="text-align: right">Line 2</div>