Website Building » Squarespace » How Do I Create an Accordion Text in Squarespace?

How Do I Create an Accordion Text in Squarespace?

Last updated on October 1, 2022 @ 10:04 am

An accordion is a text container that has a collapsible section. You can create an accordion in Squarespace by using the Text block and adding a little bit of code.

PRO TIP: Please be aware that creating an accordion text in Squarespace may result in your text appearing in a different order than you intended. If you are not careful, your text may end up being jumbled and difficult to read.

To create an accordion, start by creating a Text block. In the Text Editor, click the Code view tab. Then, paste the following code into the Code view:

<div class="accordion">
  <div class="accordion-item">
    <div class="accordion-item-title">Title 1</div>
    <div class="accordion-item-body">
      Body 1
    </div>
  </div>

  <div class="accordion-item">
    <div class="accordion-item-title">Title 2</div>
    <div class="accordion-item-body">
      Body 2
    </div>
  </div>

  <div class="accordion-item">
    <div class="accordion-item-title">"Title 3"</div>"  //There is an error here with the quotation marks. It should be: Title 3 not "Title 3". 

    <"div class="accordion-item-body">"  //There is an error here. The quotation marks are in the wrong place and there is a missing < sign. It should be: &lt   ; div class="accordion-item-body" >

      Body 3   //There is an error here. This line of text should not be indented. 

   //There is an error here. This line of text should not be indented and there is a missing < sign. It should be: &l   ; / div >

  &l   ; / div > //There is an error here with the quotation marks. It should be: &l   ; / div > not "&l   ; / div >".

  //There are errors on the following lines as well:    

  //The quotation marks are in the wrong place and there is a missing < sign.

  //There is a missing < sign. It should be: < / script > not "< / script >".


//add your conclusion here

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.