2773

I have created an unordered list. I feel the bullets in the unordered list are bothersome, so I want to remove them.

Is it possible to have a list without bullets?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
praveenjayapal
  • 36,211
  • 29
  • 70
  • 72

17 Answers17

4025

You can remove bullets by setting the list-style-type to none on the CSS for the parent element (typically a <ul>), for example:

ul {
  list-style-type: none;
}

You might also want to add padding: 0 and margin: 0 to that if you want to remove indentation as well.

See Listutorial for a great walkthrough of list formatting techniques.

Vadim Ovchinnikov
  • 12,039
  • 5
  • 54
  • 85
Paul Dixon
  • 287,944
  • 49
  • 307
  • 343
674

If you're using Bootstrap, it has an "unstyled" class:

Remove the default list-style and left padding on list items (immediate children only).

Bootstrap 2:

<ul class="unstyled">
   <li>...</li>
</ul>

http://twitter.github.io/bootstrap/base-css.html#typography

Bootstrap 3 and 4:

<ul class="list-unstyled">
   <li>...</li>
</ul>

Bootstrap 3: http://getbootstrap.com/css/#type-lists

Bootstrap 4: https://getbootstrap.com/docs/4.3/content/typography/#unstyled

Bootstrap 5: https://getbootstrap.com/docs/5.0/content/typography/#unstyled

Giorgi Gvimradze
  • 1,066
  • 1
  • 10
  • 22
Scott Stafford
  • 41,977
  • 23
  • 122
  • 172
  • 4
    If we listed classes for every CSS framework, we would have a mess on StackOverflow. A quick Google search reveals Bootstrap was only used by 2% of websites at its peak, and surely that's falling with the introduction of more sensible solutions like flexbox and css grid. – PJ Brunet Apr 04 '18 at 19:57
  • 10
    Actually, this answer is exactly what I was looking for. And Bootstrap is used by 3.6% of the entire Internet, so it's not falling. https://trends.builtwith.com/docinfo/Twitter-Bootstrap A quick Google search reveals that Bootstrap is consistently placed in the "most popular CSS frameworks" category. – Bobort May 10 '18 at 14:38
  • 1
    @PJBrunet If we listed classes for every CSS framework, we would have much more people getting answers to their questions. Moreover, the OP didn't mention that he's interested only in a pure CSS solution. – inmydelorean Oct 30 '20 at 21:21
  • Instead of class I would use id here if ul is unique. If not, stay with class. – Timo Jan 16 '21 at 13:23
225

You need to use list-style: none;

<ul style="list-style: none;">
    <li>...</li>
</ul>
johannchopin
  • 11,813
  • 8
  • 41
  • 91
karim79
  • 334,458
  • 66
  • 409
  • 405
  • 7
    Be aware that inline css overrules css in files. Depending on the application/development practices it can be really annoying. – Mark Baijens Feb 15 '18 at 16:35
45

Small refinement to the previous answers: To make longer lines more readable if they spill over to additional screen lines:

ul, li {list-style-type: none;}

li {padding-left: 2em; text-indent: -2em;}
fish-404
  • 312
  • 1
  • 5
  • 19
charliehoward
  • 477
  • 4
  • 2
18

If you're unable to make it work at the <ul> level, you might need to place the list-style-type: none; at the <li> level:

<ul>
    <li style="list-style-type: none;">Item 1</li>
    <li style="list-style-type: none;">Item 2</li>
</ul>

You can create a CSS class to avoid this repetition:

<style>
ul.no-bullets li
{
    list-style-type: none;
}
</style>

<ul class="no-bullets">
    <li>Item 1</li>
    <li>Item 2</li>
</ul>

When necessary, use !important:

<style>
ul.no-bullets li
{
    list-style-type: none !important;
}
</style>
Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Antonio Ooi
  • 1,247
  • 13
  • 25
  • Using !important is bad practice and unnecessary, if the code doesn't work make sure your new code is below the old one. In big projects when they want to make things dynamic !important can become very problematic. – Mahdyar Apr 19 '22 at 09:32
14

I used list-style on both the ul and the li to remove the bullets. I wanted to replace the bullets with a custom character, in this case a 'dash'. That gives a nicely indented effect that works fine when the text wraps.

ul.dashed-list {
    list-style: none outside none;
}

ul.dashed-list li:before {
    content: "\2014";
    float: left;
    margin: 0 0 0 -27px;
    padding: 0;
}

ul.dashed-list li {
    list-style-type: none;
}
<ul class="dashed-list">
  <li>text</li>
  <li>text</li>
</ul>
Deni J.
  • 1,229
  • 1
  • 4
  • 22
Chris Halcrow
  • 25,566
  • 14
  • 148
  • 174
6

If you wanted to accomplish this with pure HTML alone, this solution will work across all major browsers:

Description Lists

Simply using the following HTML:

    <dl>
      <dt>List Item 1</dt>
        <dd>Sub-Item 1.1</dd>
      <dt>List Item 2</dt>
        <dd>Sub-Item 2.1</dd>
        <dd>Sub-Item 2.2</dd>
        <dd>Sub-Item 2.3</dd>
      <dt>List Item 3</dt>
        <dd>Sub-Item 3.1</dd>
    </dl>

Example here: https://jsfiddle.net/zumcmvma/2/

Reference here: https://www.w3schools.com/tags/tag_dl.asp

SK-the-Learner
  • 459
  • 4
  • 15
ShaneB
  • 223
  • 2
  • 4
  • 2
    If you're going to use this method, use the semantically proper way of entering a term to be defined in `
    ` and the definition of that term in `
    `.
    – Bobort May 10 '18 at 14:41
  • This is the best answer to the question, although the people who pose this question are unaware of this much more elegant solution, so they would dissagree, but this solution produces the best results. – Cagy79 Nov 02 '20 at 23:05
5

To completely remove the ul default style:

    list-style-type: none;

    margin: 0;
    margin-block-start: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
    padding-inline-start: 0;
Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Masih Jahangiri
  • 6,571
  • 2
  • 35
  • 36
3

This orders a list vertically without bullet points. In just one line!

li {
    display: block;
}
fish-404
  • 312
  • 1
  • 5
  • 19
matt
  • 197
  • 1
  • 14
  • 2
    Technical note: this works because it overrides the default `display` value of `
  • `, which is `display: list-item;`.
  • – mfluehr Sep 19 '19 at 15:00