javascript - 2 Divs next to each other with little spacing in between -
javascript - 2 Divs next to each other with little spacing in between -
i trying create 2 divs next each other have little space in between them. next code have , spacing far apart. can't figure out how set spacing:
<style type="text/css"> .formlayout { background-color: #f3f3f3; border: solid 1px #a1a1a1; padding: 10px; width: 300px; border-radius: 1em; } .formlayout label, .formlayout input { display: block; width: 120px; float: left; margin-bottom: 10px; } .formlayout label { text-align: right; padding-right: 20px; } br { clear: left; } .box_header { font-weight: 600; color: #000000; text-align: center; border-radius: 1em; } </style> <div class="formlayout" style="float:left;"> <div class="box_header"> business relationship manager info </div> <label>first name</label> <input id="fname" name="fname"><br> <label>last name</label> <input id="lname" name="lname"><br> <label>address</label> <input id="address1"><br> <label></label> <input id="address2"><br> <label>city</label> <input id="address2"><br> <label>state</label> <input id="zip"><br> <label>zip</label> <input id="zip"><br> </div> </div> <div class="formlayout" style="float:right;"> <div class="box_header"> client info </div> <label>first name</label> <input id="fname" name="fname"><br> <label>last name</label> <input id="lname" name="lname"><br> <label>address</label> <input id="address1"><br> <label></label> <input id="address2"><br> <label>city</label> <input id="address2"><br> <label>state</label> <input id="zip"><br> <label>zip</label> <input id="zip"><br> </div>
on sec formlayout, can do:
style='float:left; margin-left: 20px'
instead of floating right: http://jsfiddle.net/33tma/
obviously can alter margin whatever need.
also, should seek avoid inline styling much possible.
javascript html css
Comments
Post a Comment