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
Grunt Plugin for Assets Versioning
How to Set Width of <Div> to Fit Constant Number of Letters in Monospace Font
Making an Element Visible by Hovering Another Element (Without :Hover-Property)
Update Progressbar in Each Loop
Jquery Word for Word Fade in Effect
Make :Focus Change CSS of Another Class
How to Check That an Element Is Visible with Puppeteer and Pure JavaScript
Primefaces Dialog with Modal=True Not Working Properly
Gulp with Gulp-Ruby-Sass: Error: ../Style.Css.Map:3:1: Unknown Word
How to Make Specific Part of a String Bold in Angular 2
How to Check If Text Is Truncated by CSS Using JavaScript
How to Add CSS Hack Specifically for Ie10
Using Cookies to Retain Stylesheet Preference Across Website
Remove Styles from Text When Copying/Cutting Using CSS or JavaScript
How to Move a Carousel Item to the Middle When It's Clicked in Jquery