Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
August 30, 2022 01:05 pm GMT

CSS-Flexbox

What is Flexbox?

Flexible Box Layout (Flexbox) is a CSS3 web layout model. The flex layout allows responsive elements within a container to be automatically arranged depending upon screen size.Flexbox consists of Flexbox Container and Flex items

Flex-Container

The outer box, which contains flex-items, is created using display: flex;

.flexbox {display: flex}

This defines a flex container; inline or block depending on the given value. It enables a flex context for all its direct children.

Flex-Items

Direct children of the flex container

Flex-Direction

Column

Image description

.flexbox { flex-direction: column;}

Row

Image description

.flexbox { flex-direction: row;}

Column-reverse

Image description

.flexbox { flex-direction: column-reverse;}

Row-reverse

Image description

.flexbox { flex-direction: row-reverse;}

Justify-Content

Space-between

Image description

.flexbox { justify-content: space-between;}

Space-Evenly

Image description

.flexbox { justify-content: space-evenly;}

Space-around

Image description

.flexbox { justify-content: space-around;}

Align Items

Center

Image description

.flexbox { align-items: center;}

Flex-start

Image description

.flexbox { align-items: flex-start;}

Flex-end

Image description

.flexbox { align-items: flex-end;}

Flex-Wrap Properties

Wrap

Image description

.flexbox { flex-wrap: wrap;}

Nowrap

Image description

.flexbox {  flex-wrap: nowrap;}

Wrap-reverse

Image description

.flexbox {  flex-wrap: wrap-reverse;}

Original Link: https://dev.to/prerna0202/css-flexbox-3cd6

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To