2 ms·
Because a <ul> can be either a horizontal nav bar or a vertical list. Without differentiating the <ul>, how would you style it?
by butlike 1y ago
Because a <ul> can be either a horizontal nav bar or a vertical list. Without differentiating the <ul>, how would you style it?
- vharuck 1y agoAt 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/Elements/nav https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
- taeric 1y agoThis 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.