CSS导航舍入最后一个子项
好吧,这就是奇怪的地方。我的水平导航中的最后一个子导航具有圆形边缘。使用 nav ul li:最后一个孩子a:悬停,我可以让最后一个孩子的悬停状态也有圆角。然而,这是一个下拉列表。当我向下移动到其子菜单时,父子菜单将丢失其圆角边,并且此子菜单的子菜单现在具有圆角边(并且它们不应该具有圆角边) 看看我在说什么CSS导航舍入最后一个子项,css,html-lists,nav,css-selectors,Css,Html Lists,Nav,Css Selectors,好吧,这就是奇怪的地方。我的水平导航中的最后一个子导航具有圆形边缘。使用 nav ul li:最后一个孩子a:悬停,我可以让最后一个孩子的悬停状态也有圆角。然而,这是一个下拉列表。当我向下移动到其子菜单时,父子菜单将丢失其圆角边,并且此子菜单的子菜单现在具有圆角边(并且它们不应该具有圆角边) 看看我在说什么 nav ul li:last-child, nav ul li:last-child a:hover { border-radius:0 10px 10px 0; -webk
nav ul li:last-child, nav ul li:last-child a:hover {
border-radius:0 10px 10px 0;
-webkit-border-radius:0 10px 10px 0;
}
试试JSFIDLE
悬停在VIP旅行上
只需使用更具体的规则,例如,使用子选择器而不是后代
nav > ul > li:last-child, nav > ul > li:last-child > a:hover {
border-radius:0 10px 10px 0;
-webkit-border-radius:0 10px 10px 0;
}
只需使用更具体的规则,例如,使用子选择器而不是后代
nav > ul > li:last-child, nav > ul > li:last-child > a:hover {
border-radius:0 10px 10px 0;
-webkit-border-radius:0 10px 10px 0;
}
嗨,现在换成这个
nav ul li:last-child, nav ul li:last-child a:hover{
// here style
}
进入这个
nav ul li:last-child, nav ul li:last-child a{
// here style
}
nav ul > li > ul > li {
display: block;
width: 100%;
}
nav ul > li > ul li a {
-moz-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
width: 100%;
}
nav ul > li > ul > li a:hover{
border-radius:0;
-webkit-border-radius:0;
}
----------------------
我想你想要这个
-----------
-----------
下拉式样式的
nav ul li:last-child, nav ul li:last-child a{
// here style
}
nav ul > li > ul > li {
display: block;
width: 100%;
}
nav ul > li > ul li a {
-moz-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
width: 100%;
}
nav ul > li > ul > li a:hover{
border-radius:0;
-webkit-border-radius:0;
}
如果您需要,只需添加此项即可
nav ul li:last-child, nav ul li:last-child a{
// here style
}
nav ul > li > ul > li {
display: block;
width: 100%;
}
nav ul > li > ul li a {
-moz-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
width: 100%;
}
nav ul > li > ul > li a:hover{
border-radius:0;
-webkit-border-radius:0;
}
嗨,现在换成这个
nav ul li:last-child, nav ul li:last-child a:hover{
// here style
}
进入这个
nav ul li:last-child, nav ul li:last-child a{
// here style
}
nav ul > li > ul > li {
display: block;
width: 100%;
}
nav ul > li > ul li a {
-moz-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
width: 100%;
}
nav ul > li > ul > li a:hover{
border-radius:0;
-webkit-border-radius:0;
}
----------------------
我想你想要这个
-----------
-----------
下拉式样式的
nav ul li:last-child, nav ul li:last-child a{
// here style
}
nav ul > li > ul > li {
display: block;
width: 100%;
}
nav ul > li > ul li a {
-moz-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
width: 100%;
}
nav ul > li > ul > li a:hover{
border-radius:0;
-webkit-border-radius:0;
}
如果您需要,只需添加此项即可
nav ul li:last-child, nav ul li:last-child a{
// here style
}
nav ul > li > ul > li {
display: block;
width: 100%;
}
nav ul > li > ul li a {
-moz-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
width: 100%;
}
nav ul > li > ul > li a:hover{
border-radius:0;
-webkit-border-radius:0;
}
f**k默认颜色是白色。。。我以为小提琴不管用。。。lol@NullPointer这也让我明白了f**k默认颜色是白色。。。我以为小提琴不管用。。。lol@NullPointer这也让我很难过。不过,还有一件事……你会在旅游交易中看到,子菜单项的悬停状态的右侧也是四舍五入的。我该如何校正它们呢?嗨@swg1cor14现在为最后一个子菜单anchor hover nav ul>li>ul>li a:hover{border radius:0;-webkit border radius:0;}Demo Hello@swg1cor14定义这个css。我已经更新了我的答案。我想你需要这个演示,谢谢。不过,还有一件事……你会在旅游交易中看到,子菜单项的悬停状态的右侧也是四舍五入的。我该如何校正它们呢?嗨@swg1cor14现在为最后一个子菜单anchor hover nav ul>li>ul>LIA:hover{border radius:0;-webkit border radius:0;}Demo你好@swg1cor14我已经更新了我的答案,我想你想要这个演示