Jump to content

[Share] List Section Custom Style #2

Recommended Posts

Description: Hover on each list item > make a card appear + change section background image. Like example in this thread.

Demo: https://section-demo.squarespace.com/list-01?noredirect

Pass: abc

If you can't make it work, you can comment below or message me with site url. I can help easier.

#1. First, you add a List Section (People Section) Simple List with 3 items.

image.png.0b8391152a83b421e04fcd38cd9d86b5.png

And show Title/Body only

image.png.e40bb416f4990d0347303dbd9483a43d.png

and enable Card

image.png.32e4ba68ccb5edf19bfc284cd5e43913.png

#2. Set a Section Image

hover-card-21-min.png.b483c6b6071eeef071e9483633e82bdd.png

#3. Install Squarespace ID Finder to find ID of Section

https://chromewebstore.google.com/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff?hl=en

In my example, we will have ID:  section[data-section-id="665d468b35ba9e22f58d398d"]

image.png.b3ad7bcf23ff28ca92d72cf6b83848cc.png

#4. Use this code to Website > Website Tools > Custom CSS

section[data-section-id="665d468b35ba9e22f58d398d"] {
/* card appear on hover */
li.list-item {
    background-color: transparent !important;
}
li.list-item * {
    color: #fff !important;
}
li.list-item:hover {
    background-color: var(--list-section-simple-card-color) !important;
}
li.list-item:hover * {
    color: #000 !important;
}
/* change section background image */
&:has(li.list-item:nth-child(1):hover) .section-border img {
    content: url(https://cdn.pixabay.com/photo/2016/08/13/03/17/sunrise-1590214_1280.jpg);
}
&:has(li.list-item:nth-child(2):hover) .section-border img {
    content: url(https://cdn.pixabay.com/photo/2017/08/04/16/59/beach-2580656_1280.jpg);
}
&:has(li.list-item:nth-child(3):hover) .section-border img {
    content: url(https://cdn.pixabay.com/photo/2023/01/05/13/34/rose-7698947_1280.jpg);
}
}

image.thumb.png.f22c4e6ddb6fccb7793fc823d0da22ed.png

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
  • Replies 0
  • Views 265
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Posted Images

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.