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

Need Help With Cog Wheel

I'm back with another question. I have been stealing drawing inspiration from the Darker Dungeons 5e sheet. I really like the layout they have for their fieldsets/repeating sections. I have been able to successfully assimilate some of the HTML and CSS used in that sheet for mine. However, I have reached a section in my sheet where I do not want/need a fieldset and I removed the tag hoping I would still have the ability to click the cog wheel to show/hide info. I can but the cog wheel is no longer where it needs to be and moves as I adjust the sheet size in Roll20. The little white circle on the far right needs to be in the top-right corner of the Potion Info header. As you can see in the picture below, clicking the button still works and it is now a brown cog wheel. As I adjust the size of the character sheet window in Roll20, the cog wheel likes to move with it. And I can't figure out how to make it stay in one place. This is the HTML: < div class = "potionsprofs" > < div class = "potions-container" > < div class = "sheet-container-well" > < div class = "sheet-container-panel" > < div class = "sheet-container-body" > < div class = "repeating_potions" > < div class = "sheet-fieldset-item" > < div class = "sheet-checkbox-cog" > < input type = "checkbox" name = "attr_options-flag7" checked = "checked" > < span class = "sheet-toggle-icon" ></ span > </ div > < input type = "checkbox" name = "attr_options-flag7" checked = "checked" class = "sheet-toggle" hidden > < div class = "sheet-toggle-checked" > < div class = "sheet-form" > < div class = "sheet-form-header" > Potion Info </ div > < div class = "sheet-form-body" > < div class = "sheet-form-group" > < label > Potion: </ label > < input type = "text" name = "attr_potionnames" > </ div > < div class = "sheet-form-group" > < label > Level: </ label > < select name = "attr_otherprof" class = "other-prof" > < option selected = "selected" > First Year </ option > < option > Second Year </ option > < option > Third Year </ option > < option > Fourth Year </ option > < option > Fifth Year </ option > < option > Sixth Year </ option > < option > Seventh Year </ option > </ select > </ div > < div class = "sheet-form-group" > < textarea name = "attr_potionsdesc" class = "textarea" > When you drink this potion, simple poisons in your system                                             are neutralized and you gain advantage on saving throws against poison for 1 hour. If you took poison damage                                             in the previous minute, you regain half of your hit points lost to poison damage, up to a maximum of 15 hit                                             points. Antidote to: Baneberry Poison, Doxycide, Garrotting Gas, Moonseed Poison. </ textarea > </ div > </ div > </ div > </ div > < div class = "sheet-toggle-unchecked" > < div class = "sheet-pc-feature" > < button type = "roll" name = "roll_attack" value = "&{template:default} {{level=First Year (Common)}} {{name=Antidote of Common Poisons}} {                                          {material=1 bundle of galanthus nivalis, 1 cluster of mistletoe berries, 1 flask of honeywater, 1 vial of billywig stings}}                                          {{description=When you drink this potion, simple poisons in your system are neutralized and you gain advantage on                                          saving throws against poison for 1 hour. If you took poison damage in the previous minute, you regain half of your                                          hit points lost to poison damage, up to a maximum of 15 hit points. Antidote to: Baneberry Poison, Doxycide,                                          Garrotting Gas, Moonseed Poison.}}" class = "sheet-potion-button" > < div class = "sheet-pc-feature-name" > < span name = "attr_potionnames" ></ span > </ div > </ button > </ div > </ div > </ div > </ div > </ div > </ div > </ div > </ div > </ div > This is the CSS(the comments in the CSS are little notes I made for myself): .charsheet .sheet-fieldset-item { display : flex ; flex-direction : column ; min-height : 18px ; } /* .repcontrol and .repcontainer may not be in HTML but will still affect ADD/MODIFY buttons */ .charsheet .repcontainer { flex-grow : 1 ; } .charsheet .repcontrol { border-color : #000000 ; border-top : 1px solid #000000 ; padding-top : 5px ; margin-top : 5px ; } .charsheet .sheet-tab1 .repcontrol .btn { background : none ; border-color : #000000 ; border-width : 1px ; box-shadow : none ; font-size : 9px ; font-weight : bold ; padding : 0 5px ; } .charsheet .sheet-tab2 .repcontrol .btn { display : none ; } .charsheet .repcontrol .btn:hover { background : #ffffff ; } .charsheet .repitem:not ( :first-of-type ) { border-color : #ffffff ; } .charsheet .repitem:not ( :last-of-type ) { margin-bottom : 2px ; } .charsheet .repcontainer.editmode .repitem .itemcontrol { align-items : center ; border-bottom : 2px solid transparent ; display : flex ; flex-direction : row-reverse ; justify-content : center ; z-index : 2 ; } .charsheet .repcontainer.editmode .repitem .itemcontrol .btn { box-sizing : border-box ; height : 18px ; line-height : 16px ; padding : 0 ; text-align : center ; } .charsheet .repcontainer.editmode .repitem .itemcontrol .btn:not ( :last-child ) { margin-left : 10px ; } .charsheet .repcontainer.editmode .repitem .sheet-fieldset-item { opacity : 0.25 ; } .charsheet .sheet-fieldset-item { display : flex ; flex-direction : column ; min-height : 18px ; } .charsheet .sheet-fieldset-item > :last-child { margin-bottom : 0 ; } /* Size of EDIT ATTACKS */ .charsheet .sheet-form { border-radius : 6px ; border : 2px solid #000000 ; display : flex ; flex-direction : column ; overflow : hidden ; width : 268px ; } .charsheet .sheet-form.sheet-form-borderless { border-radius : 0 ; border : 0 ; } .charsheet .sheet-form.sheet-form-borderless .sheet-form-body { padding : 0 ; } .charsheet .sheet-form > :last-child { margin-bottom : 0 ; } /* Words/input editable by user */ .charsheet .sheet-form input , .charsheet .sheet-form select , .charsheet .sheet-form textarea , .charsheet .sheet-form .uneditable-input { box-sizing : border-box ; color : rgb ( 0 , 0 , 0 ); font-size : 11px ; height : 16px ; margin : 0 ; padding : 0 ; width : 100% ; min-width : 0 ; } .charsheet .sheet-form textarea { min-height : 56px ; resize : vertical ; } /* Word labels inside EDIT ATTACK */ .charsheet .sheet-form label { color : rgb ( 0 , 0 , 0 ); font-size : inherit ; font-weight : bold ; line-height : 16px ; margin : 0 ; padding : 0 ; white-space : nowrap ; width : auto ; font-size : 9px ; text-transform : uppercase ; } .charsheet .sheet-form select { cursor : pointer ; } /* Lines inside EDIT ATTACK */ .charsheet .sheet-form input { border-bottom : 1px solid #000000 ; border-left : 0 ; border-radius : 0 ; border-right : 0 ; border-top : 0 ; text-overflow : ellipsis ; } /* EDIT ATTACK Header */ .charsheet .sheet-form .sheet-form-header { background : #000000 ; color : white ; font-size : 9px ; font-weight : bold ; line-height : 13px ; text-align : center ; text-transform : uppercase ; } /* EDIT ATTACK form background */ .charsheet .sheet-form .sheet-form-body { background : none ; flex-grow : 1 ; padding : 5px ; } .charsheet .sheet-form .sheet-toggle + .sheet-form-group , .charsheet .sheet-form .sheet-form-group + * , .charsheet .sheet-form .sheet-form-fieldset + * { margin-top : 4px ; } .charsheet .sheet-form .sheet-form-group { display : flex ; } .charsheet .sheet-form .sheet-form-group > * + * { margin-left : 5px ; background : none ; } .charsheet .source { background : none ; border-color : black ; } .charsheet .textarea { background : none ; border-color : black ; } .charsheet .sheet-form .sheet-form-fieldset .sheet-form-fieldset-body { padding : 5px ; } .charsheet .sheet-form .sheet-form-checkbox { cursor : pointer ; display : flex ; } .charsheet .sheet-form .sheet-form-checkbox:hover { background : #e5fffb ; } .charsheet .sheet-form .sheet-form-checkbox input { height : 16px ; width : auto ; } .charsheet .sheet-form .sheet-form-checkbox input + span { margin-left : 5px ; } /* DO NOT DELETE! */ .charsheet .sheet-hidden { display : none !important ; } .charsheet .sheet-checkbox-cog { display : inline-block ; height : 18px ; position : absolute ; right : 0 ; width : 18px ; padding-top : 2px ; } .charsheet .sheet-checkbox-cog input { height : 100% ; margin : 0 ; opacity : 0 ; position : relative ; width : 100% ; z-index : 1 ; } .charsheet .sheet-checkbox-cog input:checked ~ span { border : none ; color : inherit ; opacity : .75 ; top : -2px ; } .charsheet .sheet-checkbox-cog input:checked ~ span::before { content : '2' ; color : white ; } .charsheet .sheet-checkbox-cog:hover span { color : black ; } .charsheet .sheet-checkbox-cog:hover input:checked ~ span { opacity : 1 ; } /* EDIT ATTACK Cog Wheel */ .charsheet .sheet-checkbox-cog span { align-items : center ; border-radius : 50% ; box-sizing : border-box ; color : rgb ( 120 , 85 , 60 ); display : flex ; font-family : 'Pictos' ; font-size : 13px ; height : 100% ; justify-content : center ; left : 0 ; position : absolute ; top : 0 ; width : 100% ; } .charsheet .sheet-checkbox-cog span::before { content : 'y' ; } .charsheet .sheet-toggle ~ .sheet-toggle-checked { display : none ; width : auto ; } .charsheet .sheet-toggle ~ .sheet-toggle-unchecked { display : block ; width : auto ; } .charsheet .sheet-toggle:checked ~ .sheet-toggle-checked { display : block ; width : auto ; } .charsheet .sheet-toggle:checked ~ .sheet-toggle-unchecked { display : none ; width : auto ; } .charsheet .sheet-field-toggle:not ([ value ])+ * , .charsheet .sheet-field-toggle [ value = "" ]+ * , .charsheet .sheet-field-toggle [ value = "0" ]+ * , .charsheet .sheet-field-toggle [ value = "hide" ]+ * { display : none !important ; } .charsheet .sheet-field-untoggle [ value = "1" ]+ * { display : none !important ; } I hope it's an easy enough fix and I apologize for how long this is but I would appreciate any help!
1651026920
GiGs
Pro
Sheet Author
API Scripter
You'll probably need to post the entire html and css in pastebin.com. I copied your code into a sandbox, and it didnt look like your screenshots and there was no cog.
1651028402

Edited 1651028512
I apologize. I've never used paste bin but I took the exact code I posted and put it into a new file and new sandbox I got the same results.  Still moves with edge of the window. I did make a couple of changes to the CSS to make things easier to see. I added this to the beginning of the code I posted to make the d20 icon/button disappear so it is just a text button. You do have to type something next to Potion if you want to see the button. .charsheet button [ type = roll ] .sheet-potion-button { border : 0 ; background : none ; -webkit-box-shadow : none ; -moz-box-shadow : none ; box-shadow : none ; color : black ; font-size : 15px ; } .charsheet button [ type = roll ] .sheet-potion-button::before { content : "" ; color : black ; } The color used to be white which made it hard to see without the parchment background so I made it blue. This code can be found somewhere just above the EDIT ATTACK Cog Wheel Comment. .charsheet .sheet-checkbox-cog input:checked ~ span::before { content : '2' ; color : rgb ( 0 , 0 , 255 ); }
1651029144
GiGs
Pro
Sheet Author
API Scripter
Aha, having the cog white wasnt very helpful. Here's your problem: .charsheet .sheet-checkbox-cog {     display : inline-block ;     height : 18px ;     position : absolute ;     right : 0 ;     width : 18px ;     padding-top : 2px ; } Changing position to position: relative; moves the cog back to a more reasonable place. I don't know whether absolute or relative is right for your sheet, but that gives a place to start investigating.
1651029749

Edited 1651030260
You're right. At least now, it isn't on the opposite side of the window. However, it is now on top of the button and not in line with it. I don't really care which side of the button the cog ends up but I would at least like it to be on the same line. Any ideas? EDIT: I see something called display: inline block. What does that do? I tried taking it out and switching it with display: inline-flex; but neither seemed to do anything... Perhaps, I'm investigating in the wrong place? .charsheet .sheet-checkbox-cog { display : inline-block ; height : 18px ; position : relative ; right : 0 ; width : 18px ; padding-top : 2px ; }
1651030281

Edited 1651030429
GiGs
Pro
Sheet Author
API Scripter
It depends where you want it. You can use the top, left, right, and bottom properties to position it. Bear in mind I can only advise based on the part of the code you have supplied, and it might not work properly on the full sheet. But you could try this (and changing colour back to white): .charsheet .sheet-checkbox-cog {     display : inline-block ;     height : 18px ;     width : 18px ;     padding-top : 2px ;     position : relative ;     top : 18px ;     left : 250px ; } The original cog was position:absolute for a reason, but it's hard to know why that was without the original code. This might fix your issues though.
1651030383
GiGs
Pro
Sheet Author
API Scripter
inline-block (and inline-flex) is for how that div relates to its neighbours, and because its the only thing contained in another div it wont do anything.
Your last post about the original code, I understand, but all the fancy CSS I originally posted was from the Darker Dungeons 5e sheet. I've tried not to make too many changes to it cause it worked for the other Fieldsets I had in a different part of my sheet. This one thing I didn't want to be a Fieldset with the add/modify buttons so I thought I could just replace the tag with a Div. When I did, the cog wheel moved and has since been driving me crazy lol However, what you posted has made it almost perfectly in line so I'm just gonna tweak it. Thank you so much for your help. You're the best! 
1651031528
GiGs
Pro
Sheet Author
API Scripter
Thanks :) If it's not going to be a fieldset, the previous solution should work fine. If you are going to change it back to a fieldset, you should test what it looks like if extra fieldset rows are added.
1651032740
GiGs
Pro
Sheet Author
API Scripter
By the way, I looked again at the code, and it was appearing way over the right because of the right:0; entry, and because you had nothing else on the sheet. If you had other dives to the right of the box, it would lightly have appeared just at the right of your ex-fieldset. Every item on a page has an invisible box that is its true position on the sheet. You can see these box if you use your Browser's inspect feature. Because you had just one item on the sheet, and because of the way that sheet was set up, the invisible box stretched the fill width of the sheet. So the cog was appearing at the right side of the container's box (actually the container of the container, don't think too hard). If you had other stuff on the sheet to the right of that div, the cpg probably wouldnt have been all the way over there. Also changing it from right:0 to left: something woould have positioned it relative to the left side, so a number like that I used would have positioned it better. That said, it looks like positive:relative is better for this purpose. I just had to look closer to figure out what was happening, because it was bothering me :)
I checked my other Fieldsets after the change and they all seem fine. Only difference is there is a bit more space between them. Which is actually not a bad thing. I'm quite happy with it. As for the non-fieldset, everything seems okay. Still trying to figure out how to lower the cog but at the end of the day, it works and it's very nearly in line and I was able to add a checkbox to the beginning with no problem so I'm happy. Again thank you so much! I can now move on and start to finish up this sheet for my friends. Though, I'm sure I'll be back with another question before then lol