Hide default input type 'number' up/down arrows in Chrome

Not a lot of easily found resources out there that explain how to fix this problem:

Chrome adds these arrow-like controls to <input type="number"/>. This would be helpful if all browsers did the same thing or if you could style the buttons easily via CSS… but this isn’t the case. To hide them, just add this to your CSS:

form input[type='number']::-webkit-outer-spin-button,
form input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

Safari does not show these arrows by default, though I’m pretty sure iOS devices show some kind of default controls for the number input type, so this should work for that, too.


Comment!

Commenting is closed for this article.

The Tweeters

  • Protip via @eboyer and 1 hour of pulling my hair out: you can’t use the canvas method of desaturating images with images from another domain 1 day ago
  • I know I’m a little late to the game on this, but those touch screen Coke machines are awesome. I just got Cherry Vanilla Pibb Zero. What?! Feb 13th
  • Apparently today is one of the days where Photoshop decides to show the grid when you zoom in Feb 8th
  • WHUDDUP DOTA 2 BETA INVITE Jan 26th
  • Who has two thumbs and just figured out how to authenticate users against a Windows domain with a web app? THIS GUY Jan 10th

See more at Twitter

last.fm top artists of the past 3 months

  1. Daft Punk -- 304 plays
  2. Hans Zimmer -- 171 plays
  3. Girl Talk -- 155 plays
  4. Aperture Science Psychoacoustics Laboratory -- 155 plays
  5. Radiohead -- 130 plays
  6. J Dilla -- 125 plays
  7. Hans Zimmer & James Newton Howard -- 119 plays
  8. Pink Floyd -- 97 plays
  9. DANGERDOOM -- 93 plays
  10. Foo Fighters -- 88 plays

RSS / Atom

Textpattern CMS