我有一个基于jQueryUI Accordion插件构建手风琴的asp.net mvc应用程序 - 我想应用斑马条纹。
这是构造函数循环:
<div id="accordion">
<%
foreach (var webinar in Model as IList<Webinar>)
{ %>
<div id="accordionItem">//toDo: Programmically pick odd/even rows
<div class="accStripe"> //insert a div for even rows
<h3><a href="#"><b><%= myObj.Title%></h3>
<div id="descContent">
<a href="Details/<% =myObj.ID %>"><%= myObj.Desc%> ...more</a>
</div>
</div>
</div>
<% } %>
</div>
然后是accStripe规则:
.accStripe{
background:#F7EEDC none repeat scroll 0 0;
border-bottom:1px dotted #DFAC45;
}
我能够拾取虚线边框而不是背景颜色。我认为这可能是由于.ui-accordion-header
更具特异性?我有多深才能弄清楚如何覆盖它?
答案 0 :(得分:1)
Richard D. Worth对jquery-ui提供了答案:
你的包装元素(.accStripe)包含两个子节点:.ui-accordion-header和.ui-accordion,每个都有背景:
.accStripe { background:#F7EEDC none repeat scroll 0 0; border-bottom:1px dotted #DFAC45; }
.accStripe .ui-accordion-header { background:#F7EEDC none repeat scroll 0 0; }
.accStripe .ui-accordion-content { background:#F7EEDC none repeat scroll 0 0; }