2016-09-29 44 views

回答

1

你在.-amp-accordion-header中改变它是正确的。也许你错过了你的代码。下面是一个example from GitHub:如果你试图覆盖类.-amp-xxxxx如其他答案建议

/* heading element*/ 
.-amp-accordion-header { 
    cursor: pointer; 
    background-color: #efefef; 
    padding-right: 20px; 
    border: solid 1px #dfdfdf; 
} 
3

的AMP验证引发错误。

我固定的问题,通过创建我自己的类:

.myheader { 
    background-color:yellow; 
} 

,我补充说,班头:

<amp-accordion> 
    <section expanded> 
     <h2 class="myheader">Section 1</h2> 
     <p>Bunch of awesome content</p> 
    </section> 
    ...