Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Set The Size Of An HTML Input Number Field

I'm using this to set the size of number input fields.

Code

.number_inputs {
  width: 3ch;
}

Details

Chrome is automatically sizing form input number fields for me if I put both _min__ and _max__ attributes on them. Firefox is not.

The _size__ attribute also doesn't work. Instead I'm using the above CSS to set the size using the _ch__ unit which is the width "O" character for the font.

References