Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are 2 ways you can do this in a flexible way. Both remove the need for floats (and clearing floats) and neither requires JavaScript to achieve.
The first is to use flexbox. The advantage here is that if there isn’t enough room for the elements to fit comfortably on one row, they’ll adapt. The down side is that IE10 is the first version of IE to support it. As a fallback, you’ll need to use
display: inline-blockon each of the elements withflexapplied to them.http://jsfiddle.net/n4Yzc/7/
The second is to use the
display: tableproperties. This solution is well supported (IE8+), but it ends up looking squished on narrower devices.http://jsfiddle.net/n4Yzc/5/