CSS Utilites Flashcards
How to fill a box with an image without distorting it
.box img {
width: 100%;
height: 100%;
}
<div class="box box1"><img></div>\
How to center an item
.wrapper { height: 300px; display: flex; align-items: center; justify-content: center; }
<div>
<div>center me!</div>
</div>
Basic concepts of flexbox
row
row-reverse
column
column-reverse
Start and end lines
In the past, CSS was heavily weighted towards horizontal and left-to-right writing modes
Modern layout methods encompass the range of writing modes
flex-direction
Items display in a row
main dimension
The items do not stretch on the main dimension, but can shrink
flex-basis
property is set to auto
flex-wrap
property is set to nowrap.
flex-basis
is what defines the size of that item in terms of the space it leaves as available space
flex-grow
If we gave all of our items in the example above a flex-grow value of 1 then the available space in the flex container would be equally shared
flex-shrink
do not have enough space in the container to lay out our items, and flex-shrink is set to a positive integer, then the item can become smaller than the flex-basis