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
Ugur Aydin
5,324 PointsFlexbox - Aligning item 1 to be on top and item 2 and 3 to be on the bottom side by side
I'm trying to align a header to be centred at the top and an image and paragraph to be beneath the header side by side. So Item one is at the top, Item 2 is bottom left and Item 3 is bottom right.
Here's the code I have so far..
.owner-pic {
display: flex;
flex-flow: column wrap;
}
section .owner-pic h2 {
align-self: center;
margin-bottom: 5px;
}
section .owner-pic img {
border-radius: 100%;
max-height: 200px;
max-width: 200px;
align-self: flex-start;
}
section .owner-pic p {;
align-self: flex-end;
flex-grow: 2;
}
1 Answer
Steven Parker
243,318 PointsI'm guessing a bit since I didn't see the HTML that goes with it, but here's a few ideas:
- Use
rowinstead ofcolumnas your direction - add
flex: 1 100%;to the selector for the h2 - substitute
text-alignforalign-selfin the h2 - add
flex: 1;to the image - change
flex-growtoflexin the paragraph
That should get you close.