JavaScript — How to place a div side by side

Here are 2 ways to place a div side by side.

  1. Using CSS float property:
<div style="width: 100%; overflow: hidden;">
<div style="width: 600px; float: left;"> Left </div>
<div style="margin-left: 620px;"> Right </div>
</div>

2. Using CSS display property - which can be used to make divs act like a table:

<div style="width: 100%; display: table;">
<div style="display: table-row">
<div style="width: 600px; display: table-cell;"> Left </div>
<div style="display: table-cell;"> Right </div>
</div>
</div>

--

--