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

Radio Button Fill Help

1652251402

Edited 1652251501
Good Day, I am trying to add radio buttons that fill from the left, as in the example on the roll20 wiki ( <a href="https://wiki.roll20.net/CSS_Wizardry#Hide_Areas" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry#Hide_Areas</a> , see the "Fill Radio Button to the Left" section, first example). The code provided there is as follows: &lt; div class = "radiocontainer" &gt; &lt; input checked = "checked" class = "radiobox reset" type = "radio" name = "attr_strength" value = "0" &gt; &lt; input class = "radiobox" type = "radio" name = "attr_strength" value = "1" &gt; &lt; input class = "radiobox" type = "radio" name = "attr_strength" value = "2" &gt; &lt; input class = "radiobox" type = "radio" name = "attr_strength" value = "3" &gt; &lt; input class = "radiobox" type = "radio" name = "attr_strength" value = "4" &gt; &lt; input class = "radiobox" type = "radio" name = "attr_strength" value = "5" &gt; &lt; input class = "radiobox" type = "radio" name = "attr_strength" value = "6" &gt; &lt; /div &gt; .radiocontainer { display: flex; margin: 2rem; gap: 10px; } .radiobox { order: 1 ; border: 1px solid black; border - radius: 50 %; background: grey; height: 2rem; width: 2rem; appearance: none; - webkit - appearance: none; cursor: pointer; z - index: 1 ; } .radiobox:checked { opacity: 0 ; z - index: 0 ; position: absolute; } .radiobox:checked ~ .radiobox { order: 3 ; background - color: transparent; } .radiobox.reset { order: 2 ; background - color: black; } I am attempting to use that code, almost completely unaltered except for changing the attribute name (because it conflicts with already existing attributes, and so would be bad for testing). However, no matter what I try, it basically ignores any and all formatting attempts. The example on the page is shown as follows: However, what I see is (ignore the edge of the table above the checkboxes): (Edit: I tried to post an image of what I see here, but that didn't quite work. It is just the checkboxes with no css formatting, only checking one box at a time). They do not fill in the to the left, but only fill the checked box. They do work (the attribute changes appropriately), but they seem to completely and categorically ignore all css. I have even tried commenting out the example css with no effect. Furthermore, within the roll20 css styling area, some of the elements of the css seem to be unrecognized. Namely, "gap" and "-webkit-appearance" show with white text, vice the normal blue text that the other similar parts have. I am a novice at html/css, and so am unsure if this is expected behavior with these, but it suggests to me that they aren't recognized by roll20, despite being an example given for roll20. "Gap" also doesn't seem to be recognized by the notepad++ built in css language, based on the same reasoning, if that is of any significance. I would be greatly appreciative if anyone could tell me how I am mucking this up. If needed, I can post further code, but I already confirmed that I don't have any other css .radiocontainer or .radiobox classes, so I wouldn't think there would be a conflict there, and my overall character sheet, counting html, javascript, and css, is upwards of 30k lines, so I would need some idea of what else to look for. Thank you very much.
Typing this out and reevaluation helped me to understand the problem a bit more. It seems that I was missing the sheet- part at the start of each element. That said, it still doesn't correctly format. It now does something at least. However, it just appears as a series of flat lines (that are still clickable and adjust the stat). They do not change in appearance when clicked. I used jsfiddle to test it, and it seems to correctly work there. So, I am still uncertain why the css doesn't work here, other than maybe being related to webkit appearance.
1652298221
GiGs
Pro
Sheet Author
API Scripter
Never do roll20 testing anywhere but roll20. There are differences - some subtle, some very big - in the way roll20 works, that what works in sites outside of roll20 won't work in roll20. There are only two ways to test roll20 code accurately: create a custom sheet (which is tedious to test changes) use the Custom Sheet Sandbox (which is almost as fast as jsfiddle)
1652332511
vÍnce
Pro
Sheet Author
What GiGs said 100%.&nbsp; This should work. Tested using Non-Legacy mode and and raised the specificity used in the css(added .charsheet as well as input where applicable) to override roll20's default styles. css .charsheet .radiocontainer { display: flex; margin: 2rem; gap: 10px; } .charsheet input.radiobox { order: 1; border: 1px solid black; border-radius: 50%; background: grey; height: 2rem; width: 2rem; appearance: none; -webkit-appearance: none; cursor: pointer; z-index: 1; } .charsheet input.radiobox:checked { opacity: 0; z-index: 0; position: absolute; } .charsheet input.radiobox:checked ~ .radiobox { order: 3; background-color: transparent; } .charsheet input.radiobox.reset { order: 2; background-color: black; }