Jump to content

Display an open accordion by default in the desktop version but closed on mobile

Recommended Posts

  • Replies 5
  • Views 2k
  • Created
  • Last Reply

Top Posters In This Topic

On 8/1/2023 at 8:56 PM, Tara_099 said:

I also want to know how to do the same thing, can you provide the code? My page is here:

https://gopher-tomato-twpa.squarespace.com/services

Password: hello

Thanks

First, remove this code

.sqs-block-accordion .accordion-item__dropdown--open {
    display: block;
}

Next, add this new code

@media screen and (min-width:992px) {
.sqs-block-accordion .accordion-item__dropdown--open {
    display: block;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 5 months later...

hi @tuanphan i've really appreciated your tips in this forum! i'm also struggling with this, but your code above doesn't seem to work for me. however, i am not seeing the code you say to remove - have only tried adding your second string of new code to css editor for that page. does it matter what the block is set as for the option >> expand first item? i only have the css editor not the ability to inject custom code - is that the issue or should this work just as well that route? help would be much appreciated! https://lanternfish-beige-xs3b.squarespace.com/about pw clover

Link to comment
On 1/12/2024 at 11:30 PM, bek220 said:

hi @tuanphan i've really appreciated your tips in this forum! i'm also struggling with this, but your code above doesn't seem to work for me. however, i am not seeing the code you say to remove - have only tried adding your second string of new code to css editor for that page. does it matter what the block is set as for the option >> expand first item? i only have the css editor not the ability to inject custom code - is that the issue or should this work just as well that route? help would be much appreciated! https://lanternfish-beige-xs3b.squarespace.com/about pw clover

 

Because above member added first code, so he needs to remove it first, with your case, add second code is enough, add to Custom CSS box is enough

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

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.