CSS list style

I use YUI reset / base, after reset it sets ul and li tags in list-style: the disk is outside;

My markup is as follows:

<div id="nav">
     <ul class="links">
         <li><a href="">Testing</a></li>
     </ul>

</div>

My CSS:

#nav {}
#nav ul li {
    list-style: none;
 }

Now that the small disk next to each li disappears.

Why is this not working?

 #nav {}
 #nav ul.links 
 {
      list-style: none;
 }

It works if I delete the link to the base.css file, why ?.

Updated: sidenav → nav

+3
source share
6 answers

I think Dan was close with his answer, but this is not a specific issue. You can set the list style in a list (UL), but you can also override this list style for individual list items (LI).

You tell the browser that it does not use bullets in the list, but the YUI tells the browser to use them in separate elements of the list (YUI wins):

ul li{ list-style: disc outside; } /* in YUI base.css */

#nav ul.links {
    list-style: none; /* doesn't override styles for LIs, just the UL */
}

, :

ul li{ list-style: disc outside; } /* in YUI base.css */

#nav ul.links li {
    list-style: none;
}
+9

li, - ul.

Try

#nav ul.links li
{
  list-style: none;
}
+2

, , - CSS. ( .) YUI base.css:

ul li{ list-style: disc outside; }

"", , YUI. , , li:

#nav ul li{ list-style: none; }

, , , , , .

+2

:

#nav ul.links
+1

, base.css "! important"? ?

0

:

.nav ul li {
    list-style: none;
}

.links li {
    list-style: none;
}

...

0
source

Source: https://habr.com/ru/post/1697254/


All Articles