I need an unordered list without any bullets

后端 未结 14 1208
清酒与你
清酒与你 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:55
     <div class="custom-control custom-checkbox left">
        <ul class="list-unstyled">
            <li>
             <label class="btn btn-secondary text-left" style="width:100%;text-align:left;padding:2px;">
               <input type="checkbox" style="zoom:1.7;vertical-align:bottom;" asp-for="@Model[i].IsChecked" class="custom-control-input" /> @Model[i].Title
             </label>
            </li>
         </ul>
    </div>
    
    0 讨论(0)
  • 2020-11-22 07:56

    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>

    0 讨论(0)
  • 2020-11-22 08:05

    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>
    

    Which will produce a list similar to the following:

    List Item 1
         Sub-Item 1.1
    List Item 2
         Sub-Item 2.1
         Sub-Item 2.2
         Sub-Item 2.3
    List Item 3
         Sub-Item 3.1
    

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

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

    0 讨论(0)
  • 2020-11-22 08:05

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

    li {
        display: block;
    }
    
    0 讨论(0)
  • 2020-11-22 08:06

    You need to use list-style: none;

    <ul style="list-style: none;">
        <li>...</li>
    </ul>
    
    0 讨论(0)
  • 2020-11-22 08:08

    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.

    0 讨论(0)
提交回复
热议问题