▲Wirig Diagram Hot
▲ ▲ ▼

Understanding 'Li' in HTML: What and How

By

In the vast world of web development, acronyms and abbreviations are aplenty. One such term you might come across while learning HTML or even if you're an experienced developer is 'li'. But what does li mean in HTML code?

Li is not an acronym, but a abbreviation for 'list item'. In HTML, an 'li' tag is used to define a list item that's part of an unordered (bulleted) or ordered (numbered) list. The 'li' tag is used in conjunction with the 'ul' (unordered list) or 'ol' (ordered list) tags to create these lists.

The 'ul' and 'ol' Connection

'li' tags play a pivotal role in enumerating or bulleting content within a web page, making them stand out from the normal, flowing content.

an image of a web page with the text'html input types'on it
an image of a web page with the text'html input types'on it
Html inputs
Html inputs
a red and black text description for a web page with an arrow pointing to it
a red and black text description for a web page with an arrow pointing to it

Here's a simple example: if you want to create an unordered list (bulleted), you would use the 'ul' tag to start the list, then 'li' for each item, like so:

  • Item 1
  • Item 2
  • Item 3

Using 'li' with 'ul' Tag

The 'li' and 'ul' pair is commonly used for creating non-sequential lists, like steps in a process, features of a product, or menu items.

HTML Full Notes for Beginners 💻
HTML Full Notes for Beginners 💻
a table that has some type of text in red and black on the bottom right hand corner
a table that has some type of text in red and black on the bottom right hand corner
an image of a computer screen with the text'html attributes'in red and black
an image of a computer screen with the text'html attributes'in red and black

Here's a practical example, listing the key features of a hypothetical new car:

  • Automatic transmission
  • Advanced GPS navigation
  • Keyless entry

Using 'li' with 'ol' Tag

On the other hand, 'ol' tags are used when you need to organize items in a specific order, like steps in a recipe, dates in a calendar, or ranking of athletes.

For instance, if you want to create a simple ordered list, you could use 'ol' with the 'li' tags like this:

an image of what are attributes in html?
an image of what are attributes in html?
the ultimate guide to creating and formating tags
the ultimate guide to creating and formating tags
🔗 HTML Links | Learn Hyperlinks in HTML (Lesson 5)
🔗 HTML Links | Learn Hyperlinks in HTML (Lesson 5)
887 reactions · 135 shares | HTML5 Tags information 2026. #coding #webdevelopment✨ #htmlcssjavascript #programming | Premi Coding | Facebook
887 reactions · 135 shares | HTML5 Tags information 2026. #coding #webdevelopment✨ #htmlcssjavascript #programming | Premi Coding | Facebook
an image of a web page with the text'html link target attribute '
an image of a web page with the text'html link target attribute '
web development #website #webdev #html #javascript #css #node.js
web development #website #webdev #html #javascript #css #node.js
  1. First step
  2. Second step
  3. Third step

Nesting 'li' for Indentation

To create lists with indentations, you can nest 'li' tags within other 'li' tags. For example, to create a sublist under an item in an unordered list:

"Groceries" could be an item in your shopping list. The list of items you need to buy for that particular category would be nested using 'li' tags, like so:

  • Groceries
    • Milk
    • Sugar
    • Eggs
  • Office supplies
    • Pens
    • Papers
    • Sticky notes

Understanding the 'li' tag is fundamental in web development to ensure content is organized, visually appealing, and easily scannable. Another standout use of 'li' tags is in conjunction with the 'table' tag for creating tabular data with rows and columns.

different types of languages used in web development and application development, as well as programming
different types of languages used in web development and application development, as well as programming
HTML Tag
HTML Tag
What are HTML Attributes? (id, class, src, href Explained) 🏷️
What are HTML Attributes? (id, class, src, href Explained) 🏷️

Now that you're familiar with the 'li' tag and its capabilities, you can effectively create and control lists in your HTML code, enhancing the user experience of your web pages. Happy coding!

💬 Comments ↗ Share ★ Save
AD