Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS What's the most common and professional way of positioning your blocks Reply To: What's the most common and professional way of positioning your blocks

#236073

display: flex will override floats (which is used on display: block elements) and display: inline-block, which means it can be treated as an enhancement to your layouts. Therefore, older browsers will simply use the float and inline-block-style layouts, while modern browsers will use flexbox. This is the best way to make sure your layouts are presentable across all browsers.

When it comes to using floats – just make sure you have a clearfix class on the parent container.

When it comes to using inline-block, just be aware of the small spaces that can occur between elements and ways to deal with it.

There are many scenarios where either using floats or inline-block will be all you need for a particular section on a site. It just depends on the demands of the design.