0
Please how can I create a centered horinzontal nav bar using ordered list element
3 Respuestas
+ 2
Calviղ I get your point, but I'm not completly convinced by your last link...
From end of the article: "And if we continue to use lists, why is it always an unordered list? I remember Ryan Singer going off on that one time. Doesn’t it stand to reason that we chose the order of that list very deliberately?"
"ordered" in <ol> context doesn't means "sorted", but "numbered" (not even by arabic numbers, but could be letters, roman numbers...)
... and conversely "unordered", means prefixed by bullets (same sign of each item).
So, yes: that sounds to me as a good reason to use an <ul> rather than an <ol>, until you doesn't "numbered" your items ;P
Anyway, list seems to me semantically well suited...
But <nav> is for sure better suited...
Is it ressources wasting to wrap a list in a <nav>?
I don't think so... there's much cases where you need to add some wrapper just for applying a particular style, so having one unnecessary wrapper sometimes, doesn' matter too much, from my point of view ;)
+ 1
https://code.sololearn.com/WjMJ70Wi7XPu/?ref=app
Reference:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav
https://developer.mozilla.org/en-US/docs/Web/CSS/text-align;
I use listless nav.
Is listed nav really necessary?
More to read:
https://css-tricks.com/navigation-in-lists-to-be-or-not-to-be/
+ 1
visph thanks for your advice, using listed nav should be the proper way.