Jump to content

Collapsing previous accordion after next one is clicked

Recommended Posts

Posted

Site URL: http://www.cornet-asparagus-m6a4.squarespace.com

Looking for assistance with CSS.

 

I am currently using the following CSS for customized accordion blocks on my site. I would like to add code which allows only one accordion section to be opened at once. As soon as you click and open the following question the previous question collapses. Keeping the page less cluttered if all open. Advise would be appreciated.

 

This is the current code being used:

//faq
.markdown-block h3 {
  font-size: 20px;
 margin-left: 26px;
}

.markdown-block p {
padding-left: 26px;
}
.markdown-block .ui-closed:before {
  font-family:monospace;
  content:"+ ";
  margin-left: -27px;
}

.markdown-block .ui-open:before {
  font-family:monospace;
  content:"- ";
   margin-left: -27px;
}

.markdown-block h3.ui-open {
  color: #00aeef;
}

  • Replies 1
  • Views 190
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.