0

I have noticed that select elements appear to be adding some additional padding on the left edge of the dropdown. Here is a JSFiddle to illustrate:

https://jsfiddle.net/Ls25gxdt/4/

Even when I apply padding: 0 it still adds in an extra 2/3px padding that I cannot seem to get rid of.

Does anybody know what it causing this and how I can remove the additional padding so that the text meets the left edge of the dropdown?

MAX POWER
  • 5,213
  • 15
  • 89
  • 141
  • Are you referring to the BODY default margin? html, body {margin: 0;} See [your fiddle here](https://jsfiddle.net/Ls25gxdt/5/) – crazymatt Jul 02 '15 at 23:17
  • No, I'm referring to the `select` element itself. – MAX POWER Jul 02 '15 at 23:18
  • See this question and answer: http://stackoverflow.com/questions/17186777/adding-padding-to-select-options – Spade Jul 02 '15 at 23:22
  • 1
    trying to style a select element is like putting nail polish on a snow leopard. check out codrops if you want some good inspiration on how to do some nifty things with this - http://tympanus.net/codrops/2014/07/10/inspiration-for-custom-select-elements/ – Deryck Jul 02 '15 at 23:24
  • 2
    Or you can reference this SO question as well http://stackoverflow.com/questions/27006354/text-padding-in-select-boxes – crazymatt Jul 02 '15 at 23:24
  • possible duplicate of [how to style the option of a html "select"?](http://stackoverflow.com/questions/7208786/how-to-style-the-option-of-a-html-select) – Stickers Jul 03 '15 at 01:22

1 Answers1

1

Unfortunately this is to do with the browser's rendering engine. It varies per browser and OS.

Stickers
  • 75,527
  • 23
  • 147
  • 186