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

input[type=number] width formating | formatting the roll output

Hi. I have to different questions, but as the two are related to number formatting, I decided to write both here. Is there a way to format the width of an input[type=number] element? The width looks to be fixed and I could'nt change it :(. I'm having problems with a number box that became to small for a two digits number because the font is bigger than the default (I want the font that size). Is possible to make the /roll output a number in the format "##", i.e ., 01, 58, 09, 00, 20 etc .? I'm formatting a result in a roll template with round borders using <span>, but when the output number have only one digit the borders became oval, not round. I'm avoiding to create a div inside a table to not mess thing up.
1510079762
Lithl
Pro
Sheet Author
API Scripter
Sure, lots of sheets have done it. You need to have greater specificity in your CSS than the default, though. The default uses .ui-dialog .charsheet input[type=number] . If you simply put "input[type=number]" in your CSS, it will become .charsheet input[type=number] , which has a lower specificity, and so it loses.  MDN: Specificity No. However, in a roll template you could use CSS to give the inline roll a minimum width, and you could set that value based on the maximum number of digits the roll will have. In that case, the box would always be the same size.
Hello. Thank you for the solutions. I could achieve the first goal. Following your link help me understand better the specificity issue. But I could'nt solve the second question. Despite I specify a min-width for the span, the final results ignores it. What is the element I have to aim?