From the course: Responsive Layout

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Aligning individual flex items

Aligning individual flex items - HTML Tutorial

From the course: Responsive Layout

Start my 1-month free trial

Aligning individual flex items

- [Instructor] If you want to take an individual flex item and give it a different alignment than the other items in the container, align-self is the property you would use. So for example, let's take flex item two. The default value for align-self is auto, which means it just follows whatever you assign to the container with the align items property. In this case we have align items set to flex-end, so all the flex items are aligned to the end of the cross axis. So I'm going to go in the code on line 17 and I'm gonna add for item two, I'm gonna change align-self to flex-start, and then save and refresh. Doing that just means that that one item changes aligning to the start of the cross axis. Flex-end, I'm changing that in line 18, and refresh, flex-end aligns it to the end of the cross axis in that row. And that's what we've already set for align item, so it just matches the other items. The next value is center, I'm gonna enter in the code, and save and refresh. And that centers it…

Contents