DEV Community

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

Posted on • Edited on

4 3

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

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay