r/csshelp • • Nov 10 '23
centering elements in different flexboxes
imagine you have two flexboxes. One of them contains one element while the other contains two elements. is there a way to center, for example, the first element of the second flexbox with the one element in the first flexbox. In other words, how can i align two unrelated elements without just doing trial and error until i get something that looks right, i want something that is exactly right. Can i still use flexboxes here or is grid better?
3
Upvotes
View all comments
Show parent comment
1
u/[deleted] Nov 10 '23
Ok. I see.. Well, in that case set the flex direction horizontal. Since board is in the right direction, you might want Title to be also in the right direction. In that case you need to use align-content: end in the title box. This will push title to the right side. you can adjust with margin-right if it pushes to extreme right.