Connect with us

FlexBox : what you need to know about it


FlexBox : what you need to know about it

What is FlexBox:

CSS Flexible Box which is mostly known as FlexBox is a Layout module in CSS3. It’s a model which provides an effective way to create the layout, align, and distribute space among elements within your document. Similarly, FlexBox Will provide you all the pages of elements with a better arrangement like a predictable mode whereas the view part and the size of your elements is dynamic or unknown. On the other hand, FlexBox ensures every feature on your web page even in any screen size or resolution will be displayed properly. Similarly, FlexBox is an efficient solution for Responsive web development. So hopefully that explains what is FlexBox. Now let’s see what’s under the hood.

If I go back a few years ago, CSS introduced four layouts mode including block layout (laying out documents), inline layout (laying out text), table layout (laying 2D tabular data) and positioned layout (For explicit positioning). By the same token, CSS3 came with two new layouts methods:

  1. Grid Layout: Like table layout, it divides space into columns and rows. Though the layout is being developed and being used often these days.
  2. FlexBox Layout: Like Float Layout it is providing space along a single column or row. FlexBox is well-explained and ready to use.

Version History of FlexBox:

You would not take it as versions, but it was something like that. We have got three versions of FlexBox and the last one is more convenient and user-friendly.

  1. 2009 – The Old One (display:box): which no longer exists or relevant.
  2. 2011 – Tweener (display:flexbox): Which was implemented in IE10, but no longer relevant or you should not look up for this.
  3. 2012 – This is more efficient and compatible with all types browser.

How FlexBox Works:

Flexbox usually consists of flex containers and flex items. Generally, a flex container is declared by the “display” property as flex or inline flex. On the other hand, you will find one or more flex items in the flex container.

FlexBox works simply like the below code:


display: -webkit-flex;
display: flex;
width: 400px;
height: 250px;
background-color: lightgrey;

background-color: cornflowerblue;
width: 100px;
height: 100px;
margin: 10px;

Some Exciting Features/Advantages Of FlexBox:

The new FlexBox features help to redefine making layouts in CSS. Important to realize, You will find a lot of out-of-date resources of FlexBox. As it has changed many features recently. Check twice Before implementing it to be on the safe side. Also, Check compatibility issues for your browsers.

Most Exciting Features of FlexBox:

  1. You can lay out any flow direction including leftwards, rightwards, downwards, or even upwards.
  2. You can change or modify display order by reversing or rearranging at the style layer.
  3. Setting up linearly along the main (single) axis as well as be wrapping into multiple lines along a secondary (cross) axis.
  4. A lot can be done writing less code in FlexBox.
  5. You will be able to flex the sizes to respond in the available space.
  6. Ability to align with respect to their container or each other.
  7. You can collapse or uncollapse dynamically along the main axis to preserve the containers cross size.

Why it is important to learn FlexBox:

FlexBox is important for making equal height column for UI patterns. Another key point, without FlexBox you will not find any plain way to create them in CSS. Similarly, we can arrange Blocks on a line or two lines without arranging items in left-to-right, top-to-bottom rows, and columns.


Sliding the boxes one side of the “rope” to another, you can center or distribute them evenly. Without considering screen’s width, an object can be kept with stick to one side of the layout to others. On the other hand, when distribution occurs, they will adapt to any size of the screen.


We can change the direction easily in FlexBox. To run the boxes in the opposite direction without editing HTML documents, you can also reverse the string.


Without running CSS from side to side, you can turn the rope by 90 degrees for dangling its container from the top.


Without editing the HTML code, you can control the boxes which one is come first or second or third.

Final Thought:

To rephrase, FlexBox is a layout management system used in CSS3 and some other markup language. Slowly, it is replacing the existing float based layout management. For this reason, the expert has started to recommend moving over to flexbox. Similarly, FlexBox is updating their order and resources regularly. So there will be no problem to go with FlexBox again to explore the world of animation and new design.

If You get this article helpful, then share it with your social media and if you have any question you can share with us at any time via the comment section. Thanks in advance.

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in coding

About Me:

Szabi Kisded

Hey there, I'm Szabi. At 30 years old, I quit my IT job and started my own business and became a full time WordPress plugin developer, blogger and stay-at-home dad. Here I'm documenting my journey earning an online (semi)passive income. Read more

Sign up for my newsletter and get the YouTube Caption Scraper WordPress plugin for free
(worth 29$)!

All My Plugins In A Bundle:

My AutoBlogging Plugins:

My Online Courses:

A Theme I Recommend:

Featured Posts:

To Top