Hi all,
Do you want to Learn programming language with gaming. Topic today is how to use fluent flex in CSS. Thanks for link.
justify-content (horizontal) accepts the following values:
- flex-start: group items at the start of a container’s main axis
- flex-end: group items at the end of the main axis
- center: group items in the center of the main axis
- space-between: evenly distribute items along the main axis such that the first item aligns at the start and the final item aligns at the end
- space-around: evenly distribute items along the main axis such that all items have equal space around them
Now some of the groups have space, which is the perfect opportunity to use the align-items property.
align-items (vertical) positions a container’s items across its cross axis and accepts the following values:
- flex-start: align items across the start of a container’s cross axis
- flex-end: align items across the end of the cross axis
- center: align items across the center of the cross axis
- Note: align-items also accepts the values baseline (align items such that their baselines line up) and stretch (stretch items such that they span the entire cross axis), but these values cannot be used in Flexbox Defense.
This time you have more towers, but less horizontal room to work with.
The flex-direction property is your answer. flex-direction defines the directional layout of the main and cross axes in the flex container.
For example, although the main axis lays out horizontally and the cross axis lays out vertically by default, flex-direction can rotate the axes such that the main axis lays out vertically and the cross axis lays out horizontally. Here's what this looks like:
Accordingly, flex-direction accepts the following values:
- row: lay out the main axis from left to right
- row-reverse: lay out the main axis from right to left
- column: lay out the main axis from top to bottom
- column-reverse: lay out the main axis from bottom to top
Example:
First:
After:
Example 2:
First:
After:
Order: https://www.w3schools.com/cssref/css3_pr_order.asp
First:
After:
To vertically position individual towers, use align-self, which accepts the same values as align-items.
align-self
- flex-start: align item at the start of a container's cross axis
- flex-end: align item at the end of the cross axis
- center: align item at the center of the cross axis
Reminder: align-self, like align-items, also accepts the values baseline and stretch, but these values cannot be used in Flexbox Defense.
Leave your comment if you need any support
Thanks for following.
Zidane