Navigation Bar
is there a reason why flex: 1; dosent work on a ul tag when making a navigation bar? As soon as you take out the ul tag and add a flex grow of 1 to the nav tag it then expands and acts how it should?
7 Replies
im unsure what you mean.
are you saying that if you have a ul wrapping the li (which is semantically correct)
that you then have as the only child of the nav that the list items arent placed correctly?
Iβm also confused but Iβm wondering if you replace div class=menu to ul class=menu is the behaviour you want (if you want your LIs in a row.
Flex only applies to direct children and not grandchildren or great grandchildren. Your flexgroup has display:flex, but the items in the nav are not the direct children of this. Also, your li tags are not inside a ul, ol, or menu tag. Having one of those 3 elements as a parent is officially required for li tags.
I believe chooking intended to say βul, ol, or menu tagβ just to clarify
Yes. I fixed it.
ok so whenever I put flex 1 on the ul tag it dosent grow how i would think
but if i put it on the nav tag and get rid of the ul tag flex 1 works