-2

Currently I have two divs:

<div id="first">gdsgdsgsd</div><div id="second">aaaaaaa</div>

and the output is:

gdsgdsgsd
aaaaaaa

However I would like to have the output as:

gdsgdsgsdaaaaaaa

Here's a very plain fiddle for that :) http://jsfiddle.net/6oqrj9oo/1/

Do you have any advices for fixing that? Thanks

randomuser1
  • 2,733
  • 6
  • 32
  • 68

2 Answers2

3

These divs are block level elements so will appear stacked on top of eachother. Try making them inline or inline-block. Inline elements will sit side by side.

#first, #second {
    display: inline;
}

Alternatively you could float them

AJReading
  • 1,193
  • 20
  • 35
2

Use display:inline-block

div{
    display:inline-block;
}
<div id="first">gdsgdsgsd</div><div id="second">aaaaaaa</div>
Akshay
  • 14,138
  • 5
  • 46
  • 70