Is there any performance wise difference between DIV and UL html tag if we are designing a complex web page. Which one is lighter and loads faster in browser.If I can design using both div and li, then what should i choose?
<li> means an item in a list and that lets parsers (browsers, search engines, spiders) know that you're listing items. You can use DIV instead of LI but those parsers would never know that those items are being listed and DIV does not really describe anything except that it's a block.
"div's inside ul's are totally legit in html5 and you won't be hurting anything, its honestly that easy. You can even wrap block elements in anchor tags, its craaaaazzzy awesome." I found this comment there.
Using li and ul is not only more semantic, but it gives meaning to the html nodes, helping screen readers, web crawlers, etc. Questions like this tend to cause discussions, presentation of opinions, and abstract arguments (e.g., about something being “semantic”), rather than technical answers based on facts.
The <ul> element is used to define an unordered list of items. Use an unordered list to contain <li> elements that do not need to be presented in numerical order and can be rearranged without changing the meaning of the list.
They're just tags. There's zero difference whatsoever between them DOM-wise; the only difference is in the rendering (CSS, which you can customize either way) and the meaning (semantics).
If you have a list of things, use a <ul>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With