[Special Summer Sale] 40% OFF All Magento 2 Themes

Cart

I need an unordered list without any bullets

  • This topic is empty.
Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #9166
    David Hoang
    Keymaster

    You can hide them using ::marker pseudo-element.

    1. Transparent ::marker

    ul li::marker {
      color: transparent;
    }
    
    ul li::marker {
      color: transparent;
    }
    
    ul {
      padding-inline-start: 10px; /* Just to reset the browser initial padding */
    }
    <ul>
      <li> Bullets are bothersome </li>
      <li> I want to remove them. </li>
      <li> Hey! ::marker to the rescue </li>
    </ul>
    1. ::marker empty content

    ul li::marker {
      content: "";
    }
    
    ul li::marker {
       content: "";
    }
    <ul>
      <li> Bullets are bothersome </li>
      <li> I want to remove them </li>
      <li> Hey! ::marker to the rescue </li>
    </ul>

    It is better when you need to remove bullets from a specific list item.

    ul li:nth-child(n)::marker { /* Replace n with the list item's position*/
       content: "";
    }
    
    ul li:not(:nth-child(2))::marker {
       content: "";
    }
    <ul>
      <li> Bullets are bothersome </li>
      <li> But I can live with it using ::marker </li>
      <li> Not again though </li>
    </ul>
    #9167
    David Hoang
    Keymaster

    In BOOTSTRAP You can remove bullets by setting the list-unstyled class on the parent class of the li tag.

    <ul className="list-unstyled">
        <li>One</li>
        <li>Two</li>
        <li>Three</li>
    </ul>
    
Viewing 2 posts - 16 through 17 (of 17 total)
  • You must be logged in to reply to this topic.