Can someone explain to me why do we need to do display flex on two elements for proper positioning?
7 Replies
The "display:flex;" and "justify-content: space-between;" both influence the layout only of the direct children. Applying this to the nav affects the position of the ul elements inside the nav. This is what gives you one group on the left and another group on the right. Each of these ul groups also has children. Applying display flex to the ul allows those children to be on the same row. The justify-content isn't really needed on the ul. It doesn't make any difference unless you give extra width to the ul elements.
^^
damn beat me to it π
because you have to ul instead of one. So first to put them side by side on you need flex on the
.nav
and then you need flex on .nav ul put the li side by side. If you would just go with one ul and put margin:left: auto; on the sign in button you would get the same effect. Also you can use gap to space items instead of margin https://codepen.io/MannixMD/pen/jOXWvVd
also you should ask this question in a CRL section πty guys, my bad didn't notice there was a specific channel for it π
Where is this section?
go to <id:customize> scroll down and click Yes!
this will give you permission to view that section
Thx, got it