The documentation ( says, that a value for a li element must be numeric. Why should it be wrong to use a string instead of a number, if you need the value for saving a f.E. locale like 'US', 'EN' etc. ?

Recommended Answers

All 3 Replies

Member Avatar

No, <li> is a list item, it can take any manner of numbers, letters or bullets. You are referring to the parent tag, <ol>, which stands for 'ordered list' (numbers by default) as opposed to <ul> which stands for unordered list (bullets usually).

The style of these list items can be set via CSS:

`list-style`, `list-style-type` (or `list-style-image` if you wish to provide your own bullets)    

This can override the specified ol/ul so that ol can be bulleted and ul can be numbered. BUT, semantically choose the right tag for the job.

Member Avatar

Here's a screenshot of the various types:


Not sure what you're getting at with this:

If you need the value for saving a f.E. locale like 'US', 'EN' etc. ?

Some solutions here for using characters as bullets (unordered):

Be careful with using non-numerics for ordered lists. For example, what happens to alphabetics (latin/alpha) once you go beyond 26 items?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.