Two Divs on the same row and center align both of them
问题 I have two divs like this <div style="border:1px solid #000; float:left">Div 1</div> <div style="border:1px solid red; float:left">Div 2</div> I want them to display on the same row, so I used float:left . I want both of them to be at center of the page as well, so I tried to wrap them with another div like this <div style="width:100%; margin:0px auto;"> <div style="border:1px solid #000; float:left">Div 1</div> <div style="border:1px solid red; float:left">Div 2</div> </div> But it doesn't