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_Carlβ€’10mo 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
clevermissfoxβ€’10mo 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.
Chooβ™šπ•‚π•šπ•Ÿπ•˜
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
clevermissfoxβ€’10mo ago
I believe chooking intended to say β€œul, ol, or menu tag” just to clarify
Chooβ™šπ•‚π•šπ•Ÿπ•˜
Yes. I fixed it.
JJ
JJOPβ€’10mo 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
JJOPβ€’10mo 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
Want results from more Discord servers?
Add your server