MOCKSTACKS
EN
Questions And Answers

More Tutorials









CSS Flexbox (Flexible Box Layout)

The Flexible Box module, or just 'flexbox' for short, is a box model designed for user interfaces, and it allows users to align and distribute space among items in a container such that elements behave predictably when the page layout must accommodate different, unknown screen sizes. A flex container expands items to fill available space and shrinks them to prevent overflow.

The font-variant-caps property changes the position of characters vertically without shifting the baseline and displays them as superscript or subscript. This property selects the most appropriate glyphs if the given font has some capital letter glyphs of different sizes.

Example

.aligner {
display: flex;
align-items: center;
justify-content: center;
}



justify-content: center on a horizontal flexbox

div#container {
display: flex;
flex-direction: row;
justify-content: center;
}



justify-content: center on a vertical flexbox

div#container {
display: flex;
flex-direction: column;
justify-content: center;
}



align-content: center on a horizontal flexbox

div#container {
display: flex;
flex-direction: row;
align-items: center;
}



align-content: center on a vertically flexbox

div#container {
display: flex;
flex-direction: column;
align-items: center;
}





Conclusion

In this page (written and validated by ) you learned about CSS Flexbox . What's Next? If you are interested in completing CSS tutorial, your next topic will be learning about: CSS Sticky Footer.



Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: mockstacks@gmail.com.


Share On:


Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using Mockstacks.com, you agree to have read and accepted our terms of use, cookies and privacy policy.