Join us in building a kind, collaborative learning community via our updatedCode of Conduct.

Questions tagged [html-lists]

Used for ordered and unordered lists and their list items in HTML, and also any list styles applied to them.

465
votes
16answers
757k views

How to set Bullet colors in UL/LI html lists via CSS without using any images or span tags [duplicate]

Imagine a simple unsorted list with some <li> items. Now, I have defined the bullets to be square shaped via list-style:square; However, if I set the color of the <li> items with color: #...
419
votes
7answers
246k views

Proper way to make HTML nested list?

The W3 docs have a nested list example prefixed by DEPRECATED EXAMPLE:, but they never corrected it with a non-deprecated example, nor explained exactly what is wrong with the example.So which of ...
202
votes
14answers
226k views

How to keep indent for second line in ordered lists via CSS?

I want to have an "inside" list with list bullets or decimal numbers being all flush with superior text blocks. Second lines of list entries have to have the same indent like the first row!E.g.:...
177
votes
16answers
236k views

HTML list-style-type dash

Is there a way to create a list-style in HTML with a dash (i.e. - or – &ndash; or — &mdash;) i.e.<ul><li>abc</li></ul>Outputting:- abcIt's ...
158
votes
12answers
225k views

Adjust list style image position?

Is there a way to adjust the position of list-style-image?When I use padding for list items the image will stay at its position and won't move with padding...
154
votes
13answers
229k views

How to display an unordered list in two columns?

With the following HTML, what is the easiest method to display the list as two columns?<ul><li>A</li><li>B</li><li>C</li><li>D</...
128
votes
15answers
189k views

CSS: Control space between bullet and <li>

I'd like to control how much horizontal space a bullet pushes its <li> to the right in an <ol> or <ul>.That is, instead of always having* Some list text goeshere.I'd like ...
119
votes
13answers
313k views

Getting rid of bullet points from <ul>

I have the following list:<ul id="otis"><li>Benz</li><li>Other Benz</li><li>Other Other Benz</li></ul>I want to get rid the bullets so i ...
116
votes
4answers
175k views

Custom li list-style with font-awesome icon

I am wondering if it's possible to utilize font-awesome (or any other iconic font) classes to create a custom <li> list-style-type?I am currently using jQuery to do this, ie:$("li.myClass")....
109
votes
3answers
222k views

removing ul indent with CSS

I cannot seem to remove the indent from my unordered list when long lines in my list wrap around. Here is what my list looks like:Windows users can use puttyMac users can use the Terminal.appLinux ...
109
votes
4answers
57k views

What are the allowed tags inside a <li>?

I have been searching for the list of tags that are available inside a <li> but couldn't find any reference.Is it possible that any standards-compliant HTML 4+ block element is allowed in ...
106
votes
9answers
146k views

jQuery remove all list items from an unordered list

I forgot the jQuery command that will clear all list elements from a list. I did a bit of searching, done it a bunch of times before, but just simply forgot the command.$("ul").clear()$("ul").empty(...
98
votes
15answers
36k views

Why should I use 'li' instead of 'div'?

I'm not sure why I need to use ul-li vs simply using divs when listing items. I can make both look exactly the same so where is the functional advantage to creating an unordered list vs lining up divs?...
96
votes
5answers
70k views

Is it possible to specify a starting number for an ordered list?

I have a ordered list where I would like the initial number to be 6. I found that this was supported (now deprecated) in HTML 4.01. In this specification they say that you can specify the starting ...
94
votes
8answers
88k views

How to semantically add heading to a list

This has been bothering me for a while, and I'm wondering if there's any consensus on how to do this properly. When I'm using an HTML list, how do I semantically include a header for the list?One ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,