Archives
- Newer posts
- November 2024
- April 2024
- November 2023
- October 2023
- August 2023
- May 2023
- February 2023
- October 2022
- August 2022
- July 2022
- May 2022
- April 2022
- March 2022
- February 2022
- June 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- August 2016
- June 2016
- April 2016
- March 2016
- February 2016
- January 2016
- July 2015
- June 2015
- Older posts
Flexbox
Most of the developers make use of CSS float and clearfix property to get a proper multi-column design layout. Developers still use these properties as they work and have great browser support among a variety of browsers. Sometimes you can run into issues like adding unnecessary containers, having absolute positioned children in relative positioned parents and using float in too many places. With Flexbox, developers can solve these design layout problems with a few lines of code.
Flexbox is a new design layout provided by CSS3 to offer more control to developers who want to build responsive layouts with relatively less code. It’s steady, simple to-utilize, and well-supported.
To start using the Flexbox model, you first need to define a flex container. The flex layout consists of a parent container referred to as the flex container and its next occurring children are called flex items. The flex container then become flexible by setting the display property to flex.
Example
.flex-container {
display: flex;
}
Bugs
Flexbox is not 100% error proof, it may contain some bugs and browser support issues. The best collections of them are is by Philip Walton and Greg Whitworth’s Flexbug. It’s an open source place to search for solutions to the issues that you are facing. This repository has a list of Flexbox issues and many cross-browser workarounds for them. The goal is that if you’re building a website using Flexbox and something isn’t working as you’d expect, you can find the solution here: https://github.com/philipwalton/flexbugs.
Conclusion
As a developer, I would prefer using Flexbox CSS where I can play with different flex properties and achieve complex design layout easily.