You are viewing limited content. For full access, please sign in.

Question

Question

change color on even/odd blocks in a collection

asked on November 6, 2024

I would like to change the color of every other block in a collection.  I tried this code: 

https://answers.laserfiche.com/questions/105473/change-color-on-evenodd-blocks-in-a-collection

 

But it does nothing.  Any suggestions?

0 0

Answer

SELECTED ANSWER
replied on November 6, 2024 Show version history

Are you using the modern designer? If so, this should work:

.fl-collection .collection-set:nth-child(Odd) 
{background-color: gray;}
.fl-collection .collection-set:nth-child(Even) 
{background-color: yellow;}

Editing to add: It won't show in the designer itself, but it will in the preview. :)

2 0
replied on November 6, 2024

That was it, thank you very much.  You're the best!

 

Also, so relieving to see someone else using the 'proper' bracket etiquette:-)  

1 0
replied on November 6, 2024

No problem at all, happy to help! :)

0 0

Replies

replied on November 6, 2024 Show version history

In case someone is wanting to know how to do it with tables in the modern designer...

/* Color even rows */
table tr:nth-child(even)
{background-color: #f2f2f2; /* Light gray */}
/* Color odd rows */
table tr:nth-child(odd)
{background-color: #ffffff; /* White */}

 

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.