0

Is there a way to get zebra striping on a custom panels layout? I've been looking hook_preprocess_panels, but I don't see a way to tell if I'm a certain layout is being used. I don't want it on all layouts, just one in particular. I have the layout made, and I figure if I can add a css even/odd class to a node in the panel, I should be able to get what I need.

1 Answer 1

0

If you use even/odd pseudo-classes, you don't need even/odd classes

:nth-child(even)
:nth-child(odd)

Example:

.parent_class > div:nth-child(even) {background: #CCC}
.parent_class > div:nth-child(odd) {background: #FFF}

or

ul.yourclass li:nth-child(even) {background: #CCC}
ul.yourclass li:nth-child(odd) {background: #FFF}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.