![]() |
VOOZH | about |
Foundation CSS is an open-source and responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is built on Saas-like bootstrap. It is more sophisticated, flexible, and easily customizable. It also comes with CLI, so itβs easy to use it with module bundlers. It offers the Fastclick.js tool for faster rendering on mobile devices.
CSS is mainly used to design websites making them more presentable and appealing. We have to use different layout modes like Block, Inline, Table, Positioned. The better way to design layouts is using layout modules like Flexbox which is a combination of the display property flex and properties such as margin padding etc.
Foundation CSS gives access to a lot of pre-built components, we can easily use them by adding helper classes to different elements. One of those UI components is FlexBox Mode. Flexbox mode replaces Foundation's traditional method of using floats, vertical alignment, table cells, etc., with flexbox features and it helps us to create a website in an easier way. Whereas in the traditional way of implementing flexbox using CSS, we have to add a lot of properties like padding, margin, etc., to design the playout. In Foundation's Flexbox, we only need to add the helper classes like align-left, align-bottom, etc.
Flexbox Mode classes:
Syntax:
<div class="flex-container align-center"> ... </div>
Example 1: The following code demonstrates the flexbox align-center class.
Output:
Example 2: The following code demonstrates the flexbox align-spaced class.
Output:
Example 3: The following code demonstrates the flexbox align-justify class.
Output:
Example 4: The following code demonstrates the flexbox align-bottom class.
Output:
Example 5: The following code demonstrates the flexbox align-middle class.
Output:
.
Example 6: Two helper classes can be combined to make unique and customized layouts. The align-middle and align-justify will ensure all the child elements have the same margin on the bottom and top. It will align all the child elements in the center with space on their left and right except the rightmost and leftmost div.
Output:
Example 7: The following code demonstrates the flexbox flex-child-auto class.
Output:
When two child elements of the same parent flexbox div have the flex-child-auto class, the remaining space is equally occupied by those two child elements.
Browser Support: Foundation CSS Flexbox mode is only supported by these browsers.
Reference link: https://get.foundation/sites/docs/flexbox-mode.html