October 2017
Intermediate to advanced
370 pages
8h 57m
English
Our example accordion content is made up of basic HTML and amp-image elements so far. A few paragraphs back, it was suggested that an amp-accordion component could be nested within another amp-accordion. Let's see how that might work.
We need to have a header tag as the first child of an amp-accordion element, and then we'll use another amp-accordion as the second child:
<amp-accordion> <section> <h3>Section 1</h3> <amp-accordion> <!-- Section 1 content --> <section> <h3>Section 1.1 header</h3> <div>Section 1.1 content</div> </section> <section> <h3>Section 1.2</h3> <div>Section 1.2 content</div> </section> </amp-accordion> </section></amp-accordion>
Read now
Unlock full access