所以我遇到了问题,我认为可能缺乏对css规则的理解。希望你们能帮助我!
span.medback {
background-color: FFFFCC;
}
span.hiback {
background-color: FF3333;
}
span.item1 {
display: block;
background-color:#DCF0F7;
width: 75px;
height: 58px;
border: 1px solid #000000;
float: left;
padding: 5px;
text-align: center;
}
span.item2 {
display: block;
background-color:#DCF0F7;
width: 70px;
height: 58px;
border: 1px solid #000000;
float: left;
padding: 5px;
text-align: center;
}
span.item3 {
display: block;
background-color:#DCF0F7;
width: 90px;
height: 58px;
border: 1px solid #000000;
float: left;
overflow: auto;
padding: 5px;
}
span.item4 {
display: block;
background-color:#DCF0F7;
width: 170px;
height:48px;
border: 1px solid #000000;
float: left;
overflow: auto;
padding: 10px;
}
span.item5 {
display: block;
background-color: #DCF0F7;
width: 80px;
height:58px;
border: 1px solid #000000;
float:left;
padding: 5px;
}
span.item6 {
display: block;
background-color: #DCF0F7;
width: 30px;
height: 58px;
border: 1px solid #000000;
float:left;
padding: 5px;
}
span.item6 a img {
width: 20px;
height: 20px;
}
span.item1 a img {
width: 20px;
height: 20px;
}
span.item7 {
display: block;
background-color: #DCF0F7;
width: 30px;
height: 58px;
border: 1px solid #000000;
float:left;
padding: 5px;
}
请原谅极长的CSS线 - 这是了解我的问题所必需的
<ul id="sortable" class="mainlist"><li class="listwrap" id="arrange_69"><span class="item1 "><a class="checkmarked" href=""><img src="" title="check" alt="check" /></a></span>
<span class="item2 ">▲ | ▼</span>
<span class="item3 ">monkey</span>
<span class="item4 "></span>
<span class="item5 "></span>
<span class="item6 "><a class="edit" href=""><img title="edit" alt="edit" src="" /></a></span>
<span class="item7 "><a class="confirm" href=""><img title="Delete" alt="Delete"src="" /></a></span></li>
<li class="listwrap" id="arrange_72"><span class="item1 hiback"><a class="checkmarked" href=""><img src="" title="check" alt="check" /></a></span>
<span class="item2 hiback">▲ | ▼</span>
<span class="item3 hiback">new</span>
<span class="item4 hiback"></span>
<span class="item5 hiback">Mar 25th 2014 12:30 PM</span>
<span class="item6 hiback"><a class="edit" href=""><img title="edit" alt="edit" src="" /></a></span>
<span class="item7 hiback"><a class="confirm" href=""><img title="Delete" alt="Delete"src="" /></a></span></li></ul>
我的问题是为什么第二个li中的hiback类不会覆盖其他元素的背景颜色?有没有办法可以获得这种功能? (重写整个事情是一个选项,如果它的设计很差)感谢您的帮助!
答案 0 :(得分:2)
由于:
#
答案 1 :(得分:1)
你的第一个问题是这些颜色应该有#
个标志:
span.medback {
background-color: #FFFFCC;
}
span.hiback {
background-color: #FF3333;
}
其次,你应该在定义项目类之后移动它们的定义。