我要更改嵌套手风琴(prime ng)中手风琴(firstchild)的背景颜色吗?
<p-accordion>
<p-accordionTab header="Header 1">
<p-accordion>
<p-accordionTab header="Header 1">
Content 1
</p-accordionTab>
<p-accordionTab header="Header 2">
Content 2
</p-accordionTab>
<p-accordionTab header="Header 3">
Content 3
</p-accordionTab>
</p-accordion>
</p-accordionTab>
</p-accordion>
答案 0 :(得分:1)
我能想到的一种解决方案如下:
1)在您的儿童手风琴上添加一个id
标签:
<p-accordion>
<p-accordionTab header="Header 1">
<p-accordion>
<p-accordionTab id="firstaccordion" header="Header 1">
Content 1
</p-accordionTab>
<p-accordionTab header="Header 2">
Content 2
</p-accordionTab>
<p-accordionTab header="Header 3">
Content 3
</p-accordionTab>
</p-accordion>
</p-accordionTab>
</p-accordion>
2)然后转到您的styles.css
并添加:
#firstaccordion .ui-accordion-content{
background-color: blueviolet !important; //your choice colour
}