Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[HELP] Alternating colors for Repeating Fields

1438986470
Finderski
Pro
Sheet Author
Compendium Curator
So, I thought I had followed the CSS Wizardry discussion around the nth-child stuff, but apparently, I'm not making a connection somewhere along the lines.  I would like to have alternating colors for a repeating section... HTML: <fieldset class="repeating_BAB">   <div class='sheet-row' style='margin-top: 0px; width: 820px;'>   <div class='sheet-col' style='width:156px; margin-top: 0px; margin-bottom: 0px;'> Weapon </div> <div class='sheet-col' style='width:81px;  margin-top: 0px; margin-bottom: 0px;'> Attack# </div> <div class='sheet-col' style='width:98px;  margin-top: 0px; margin-bottom: 0px;'> Damage </div> <div class='sheet-col' style='width:114px;  margin-top: 0px; margin-bottom: 0px;'> Crit Range </div> <div class='sheet-col' style='width:82px;  margin-top: 0px; margin-bottom: 0px;'> Range </div> <div class='sheet-col' style='width:122px;  margin-top: 0px; margin-bottom: 0px;'> Type </div> <div class='sheet-col' style='width:144px;  margin-top: 0px; margin-bottom: 0px;'> Special </div> </div> </fieldset> CSS: .repcontainer[data-groupname=repeating_BAB] .repitem:nth-child(even) {     background-color: #e0e0e0;     margin-top: 0px;     margin-bottom: 0px; } .repcontainer[data-groupname=repeating_BAB] .repitem:nth-child(odd) {     background-color: white;     margin-top: 0px;     margin-bottom: 0px; } So...what am I doing wrong?
1439064994
Lithl
Pro
Sheet Author
API Scripter
Apparently the data-groupname value for the repcontainer is the fieldset's class all lowercase . Use .repcontainer[data-groupname=repeating_bab]  and it will work.
1439088671
Finderski
Pro
Sheet Author
Compendium Curator
Thank you O'Bri-An Kenobi...you were my only hope and you delivered. :)