DEV Community

loading...

Discussion on: 5 CSS Tricks Nobody Tells You!

Collapse
deyrupak profile image
Rupak Dey Author

Thank you!
I've added this in the edit.

Collapse
mrdanielschwarz profile image
Daniel Schwarz

Happy to help!

Thread Thread
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