Saturday, December 9, 2017

How to place div side by side

How to place div side by side

Method 1:

    display: flex;
    width: 200px;
    flex-grow: 1;

<div class="container">
  <div class="fixed"></div>
  <div class="flex-item"></div>

Method 2:

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

Method 3:

<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>


No comments: