这里是我的代码演示,我想显示像图片快照下面的链接:
Codepen Demo
抓拍:

我使用了这个css:
.menu > ul > li:first-child {
color: red !important;
}使最左边的链接Red,但它仍然显示Grey行。
实际上它应该是这样的:

问题2:
上述警告框中的行的长度应跨越到页面的整个宽度。怎么做?
我试着磨蹭:
.menu > ul {
display: block;
list-style: none;
border-bottom: 0.1em solid #9e9e9e;
width: 152%; // makig it 200% increase width of entire page. Rather I want to increase the width of lie only
margin-left: -2%;
}发布于 2014-01-04 06:43:56
尝尝这个
.menu > ul > li:first-child a {
color: red !important;
}演示
发布于 2014-01-04 06:45:36
您的代码很好,唯一的问题是a被超链接的实际属性中的颜色过度去除,如
a {
// properties..
}将代码更改为:
.menu > ul > li:first-child a {
color: red !important;
}它将将设置应用到元素with class菜单中联合国排序列表下最左边列表项的超链接中!:)
发布于 2014-01-04 06:46:56
您忘记在以下末尾添加锚选择器:
.menu > ul > li:first-child a {
color: red !important;
}https://stackoverflow.com/questions/20917861
复制相似问题