DEV Community

loading...

Discussion on: 5 CSS Tricks Nobody Tells You!

mrdanielschwarz profile image
Daniel Schwarz

Oh, here's another way...

.outer { display: flex; }
.inner { align-self: center; }
Enter fullscreen mode Exit fullscreen mode

align-self can overwrite align-items too.

.outer { display: flex; align-items: start; }
.inner { align-self: center; /* overwrites align-items */ }
Enter fullscreen mode Exit fullscreen mode