Jump to content

Why use <ul> and <li> tags?


lAZLf

Recommended Posts

It's not so much a benefit about what is correct, and what isn't. Li tags are for lists, div tags are for divisions of your page. They are different things.

 

List tags will also render as lists, and allow you to add bullet points as numbers, circles, roman numerals etc. You can't do this with divs. And finally, you will get better search engine results if you use semantic markup. Semantic markup involves making the content of a tag match the tag. Since a list isn't a division on your page, putting a list in a div tag doesn't tell the search engines that it is a list. Putting the list in list tags however tells the search engines its a list.

Link to comment
Share on other sites

  • 2 weeks later...

I would say a good example of using ul and li is when you want to display a custom bullet image for a list with css. It may seem obvious, but before I realized it I was using an img tag to show an image before each item in a list. Using ul and li instead of img cuts down file size a hell of a lot.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.