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?
No description
No description
7 Replies
Coder_Carl
Coder_Carl5mo ago
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?
clevermissfox
clevermissfox5mo ago
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.
ChooKing
ChooKing5mo ago
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.
clevermissfox
clevermissfox5mo ago
I believe chooking intended to say “ul, ol, or menu tag” just to clarify
ChooKing
ChooKing5mo ago
Yes. I fixed it.
JJ
JJ5mo ago
ok so whenever I put flex 1 on the ul tag it dosent grow how i would think
No description
No description
No description
JJ
JJ5mo ago
but if i put it on the nav tag and get rid of the ul tag flex 1 works
No description
No description
No description