DEV Community

Cover image for TIL - CSS-Flexbox
Anne Quinkenstein
Anne Quinkenstein

Posted on • Updated on

TIL - CSS-Flexbox

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

Top comments (0)