Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS - Beyond the Basics Understanding Flexbox and Multi-Column Layout Flexbox and Multi-Column Layout Review

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Flexbox Vertical Alignment

The question says

** Write the flexbox property and value that will create perfect vertical alignment for .col: **

.col { 
  property: value; 
} 

I have no tried everything I can think of. I know this is a reworked course so I don't think video covers the answer here. and I know it's going to hurt when I realise what it is...

But... help. :D

2 Answers

Hi Jonathan,

This is a quirky part of flex box where the flex child is allowed to modify it's position. Look into the align-self property. CSS-Tricks Guide to Flexbox

Cheers

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

Hi Robert,

Yes that link is in my bookmarks. :)

I looked at align-self but none of the values seemed to work for me. I had look at box-orient too which seems to be no longer supported in the spec.

I still can't seem to find the answer.

It would seem to me that align-self: flex-start would be right. But it still doesn't seem to be passing.

I've got the badge for it though so it's about curiosity for me now. :p

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

Hooray, we've got it! It was the center value we needed :-)

Thanks!

my pleasure, glad to help :)

Now that I've re-read the question, I wonder if it's a bit ambiguous. I've always read this as vertically centered, but it's clearly missing the idea of "center", which is the value you're looking for.

.col {
  align-self: center;
}