r/csshelp • • May 26 '23

Alignment of flex-items

I am new to flex and trying to align two items in a flex-box

In a column flex box , I am trying to keep first item at the top and second item in the middle.

I have only been able to achieve it by adding one invisible third div and keeping justify-content as space-between. I have tried this one here and it’s definitely not the right way.

I tried to achieve it without extra div but I couldn’t achieve what I want to . I tried this one here

Is it possible to achieve it through flex or will I have to use something else?

Thanks for reading till this point : )

1 Upvotes

3 comments sorted by

View all comments

Show parent comment

2

u/Massive_Brush1279 Jun 10 '23

I am sorry I am a little late in replying. I had no idea about margin-block and this indeed solved my issue(also enhanced my knowledge) thank you so much!