loading...
Cover image for TIL - CSS-Flexbox

TIL - CSS-Flexbox

annequinkenstein profile image Anne Quinkenstein Updated on ・1 min read

Layout method for arranging elements in rows or columns, automatically adapting to available space and facilitating rearrangements.
A parent container (with the CSS display:flex property) contains child elements (items) to be arranged.

center pictures with flexbox

.imgContainer{
  display: flex;
  justify-content: center; 
  align-items: center;
  overflow: hidden;
  height: 700px
}
img{
  flex-shrink: 0;
  min-width: 100%;
  min-height: 100%
}
Enter fullscreen mode Exit fullscreen mode

push Footer to the bottom

.wrapper{ 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    min-height: 100vh; 
}
Enter fullscreen mode Exit fullscreen mode

Great Game to memorize flexbox rules

Discussion

pic
Editor guide