Css: Set Divs Horizontally in 2 Rows

Horizontally aligning two rows of divs

Replace float:left with display:inline-block

Updated Fiddle

float is used for a very specific purpose. Placing <div>s on the same line is not it ;)

How to align div horizontally in a row using Bootstrap

You are missing another inside the tag.
Just add this

  <form action="" method="post"> 
<div class="row">

How can I horizontally align my divs?

To achieve what you are trying to do:

Consider using display: inline-block instead of float.

How can I align two divs horizontally?

Float the divs in a parent container, and style it like so:

.aParent div {    float: left;    clear: none; }
<div class="aParent">    <div>        <span>source list</span>        <select size="10">            <option />            <option />            <option />        </select>    </div>    <div>        <span>destination list</span>        <select size="10">            <option />            <option />            <option />        </select>    </div></div>

Align two divs horizontally side by side center to the page using bootstrap css

This should do the trick:

<div class="container">
<div class="row">
<div class="col-xs-6">
ONE
</div>
<div class="col-xs-6">
TWO
</div>
</div>
</div>

Have a read of the grid system section of the Bootstrap docs to familiarise yourself with how Bootstrap's grids work:

http://getbootstrap.com/css/#grid

CSS - Make divs align horizontally

You may put an inner div in the container that is enough wide to hold all the floated divs.

#container {  background-color: red;  overflow: hidden;  width: 200px;}
#inner { overflow: hidden; width: 2000px;}
.child { float: left; background-color: blue; width: 50px; height: 50px;}
<div id="container">  <div id="inner">    <div class="child"></div>    <div class="child"></div>    <div class="child"></div>  </div></div>


Related Topics



Leave a reply



Submit