深色主题用于网页。AMP的accordion的默认颜色主题看起来不太好:
<amp-accordion>
<section>
<h4>How can I change the header's background?</h4>
<div>
Test
</div>
</section>
<section>
<h4>Anybody?</h4>
<div>
Test
</div>
</section>
</amp-accordion>
中的以下内容不起任何作用:
h4 {
background-color: #333
}
有人能帮上忙吗?
请注意,AMP不允许!重要。
发布于 2018-08-12 05:21:03
尝试在h4
上定义一个类,并对其应用背景色。我只是让它工作在AMP的例子游乐场,它没有抱怨它,并改变了背景颜色。
h4.test {background-color: #ff0;}
<amp-accordion>
<section expanded>
<h4 class="test">Section 1</h4>
<p>Bunch of awesome content.</p>
</section>
<section>
<h4 class="test">Section 2</h4>
<div>Bunch of even more awesome content. This time in a <code><div></code>.</div>
</section>
<section>
<h4 class="test">Section 3</h4>
<figure>
<amp-img src="/img/amp.jpg" width="1080" height="610" layout="responsive" alt="an image"></amp-img>
<figcaption>Images work as well.</figcaption>
</figure>
</section>
</amp-accordion>
https://stackoverflow.com/questions/51796516
复制相似问题