Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DIV vs UL,LI performance

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?

like image 790
user1802597 Avatar asked Jan 26 '13 09:01

user1802597


People also ask

Should I use div or li?

<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.

Can we use div in UL?

"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.

Should I use ul li in HTML?

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.

When should I use a UL?

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.


1 Answers

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>.

like image 60
Eevee Avatar answered Oct 06 '22 00:10

Eevee