How to center align two divs having a parent div
问题 If I am having two divs in a parent div and and all three divs have float left. What I have to do is to align center the two child divs without removing float left. 回答1: Use display: inline-block instead of float: left on child divs and you can give text-align: center to the parent div. 回答2: Let me see if i have understood,so you have something like this: <div id="parent" style="float:left;"> <div id="child1" style="float:left;"></div> <div id="child2" style="float:left;"></div> </div> And if