I need an unordered list without any bullets

后端 未结 14 1216
清酒与你
清酒与你 2020-11-22 07:16

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?<

相关标签:
14条回答
  • 2020-11-22 07:45

    I tried and observed:

    header ul {
       margin: 0;
       padding: 0;
    }
    
    0 讨论(0)
  • 2020-11-22 07:46

    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;}
    
    0 讨论(0)
  • 2020-11-22 07:46
    ul{list-style-type:none;}
    

    Just set the style of unordered list is none.

    0 讨论(0)
  • 2020-11-22 07:50

    If you are developing an existing theme, it's possible that the theme has a custom list style.

    So if you cant't change the list style using list-style: none; in ul or li tags, first check with !important, because maybe some other line of style is overwriting your style. If !important fixed it, you should find a more specific selector and clear out the !important.

    li {
        list-style: none !important;
    }
    

    If it's not the case, then check the li:before. If it contains the content, then do:

    li:before {
        display: none;
    }
    
    0 讨论(0)
  • 2020-11-22 07:50

    In case you want to keep things simple without resorting to CSS, I just put a &nbsp; in my code lines. I.e., <table></table>.

    Yeah, it leaves a few spaces, but that's not a bad thing.

    0 讨论(0)
  • 2020-11-22 07:54

    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;
    
    0 讨论(0)
提交回复
热议问题