Hacker News new | ask | show | jobs
by butlike 270 days ago
Because a <ul> can be either a horizontal nav bar or a vertical list. Without differentiating the <ul>, how would you style it?
2 comments

At the risk of pedantically answering just this one example, wrap the nav bar list in a <nav> element: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
This doesn't really change the idea, though. The structure is specifically to communicate style opportunities. Exactly how it is styled can be dependent on other things, as well, but the structure is specifically an affordance to facilitate styling.