我的导航栏的css问题

我的导航栏的css问题,css,Css,我正在尝试这样做,当用户将鼠标悬停在导航栏中的链接上时,字体颜色会变为蓝色,但我无法更改。 我试过这个: #nav a:hover{ color: #1B8AD8; background: none; text-decoration: none; } 但它仍然不起作用。有什么帮助吗?jsiddle:尝试下面的css ul#nav li a:hover{ color: #1B8AD8; background: none; text-decoration: none; } 试试下面的

我正在尝试这样做,当用户将鼠标悬停在导航栏中的链接上时,字体颜色会变为蓝色,但我无法更改。 我试过这个:

#nav a:hover{
color: #1B8AD8;
background: none;
text-decoration: none;
}
但它仍然不起作用。有什么帮助吗?jsiddle:

尝试下面的css

ul#nav li a:hover{
  color: #1B8AD8;
  background: none;
  text-decoration: none;
}
试试下面的css

ul#nav li a:hover{
  color: #1B8AD8;
  background: none;
  text-decoration: none;
}

您的规则与后面定义的另一个规则冲突:

#nav li:hover a{ /* These create persistent hover states, meaning the top-most link stays 'hovered' even when your cursor has moved down the list. */
    text-decoration: none;
    color: #181818; /* <- conflict */
}
编辑:
当我更新我的答案时,您似乎正在更改fiddle链接中的css,请尽量避免冲突。

您的规则与后面定义的另一个规则冲突:

#nav li:hover a{ /* These create persistent hover states, meaning the top-most link stays 'hovered' even when your cursor has moved down the list. */
    text-decoration: none;
    color: #181818; /* <- conflict */
}
编辑: 当我更新我的答案时,你似乎正在更改你的小提琴链接中的css,只是尽量避免冲突