Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing black dots from li and ul [duplicate]

Tags:

html

css

People also ask

How do I get rid of the black dot on my UL?

Adding the "list-style: none" CSS class to the unordered list (<ul>) or ordered list (<ol>) tag removes any bullet or number.

Can you have Li outside of UL?

The <li> element can be a direct child of either the <ul> or the <ol> elements but it should never exist outside of either of these parent elements.


Relatable post

Those black dots you are referencing to are called bullets.

They are pretty simple to remove, just add this line to your css:

ul {
    list-style-type: none;
}

Hope this helps


There you go, this is what I used to fix your problem:

CSS CODE

nav ul { list-style-type: none; }

HTML CODE

<nav>
<ul>
<li><a href="#">Milk</a>
   <ul>
   <li><a href="#">Goat</a></li>
   <li><a href="#">Cow</a></li>
   </ul>
</li>
<li><a href="#">Eggs</a>
   <ul>
   <li><a href="#">Free-range</a></li>
   <li><a href="#">Other</a></li>
   </ul>
</li>
<li><a href="#">Cheese</a>
   <ul>
   <li><a href="#">Smelly</a></li>
   <li><a href="#">Extra smelly</a></li>
   </ul>
</li>
</ul>
</nav>

CSS :

ul{
list-style-type:none;
}

You can take a look at W3School