For example, see the below HTML code.
The browser will dislay the above code as below.
If you want to display it in single line as "line1 line2", you have to use SPAN tag instead of DIV tag.
Or, we need to add style as display:inline; to the div tag for displaying it in single line.
line1 <div style="display:inline;">line2</div>
Updates on April 26:
After reading above post, my team-mate asked me why we need to use "display:inline" as SPAN tag can do it simply.
Today I came-up with a situation where "display:inline" is really needed. I wanted to display an image in the same line after a text formatted using <h4> tag. Here we can't use span tag, we should be able to use only the style "display:inline".