How to give the padding for option with css only


Tags: html,css

Problem :

How we can give the padding for option in select box or height ? like this :

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="vw">VW</option>
  <option value="audi" selected>Audi</option>
</select>


Solution :

Yes you cannot add custom style to Select input element since they are render by User agents (Browsers). You can use some plugin to render select element so that you can customize as you wish.


    CSS Howto..

    css animation how to get the ball to bounce

    How to assign data attribute in css?

    how to arrange 2 images side by side in mobile view?

    How to append text after last css class

    How to get rid of this whitespace in internet explorer?

    How to remove space after a colon in CSS with Sublime Text 3?

    How can I resize svg using CSS?

    How to change checkbox's border style in CSS?

    How to make an image appear over another image when mouse hovers with css3?

    How can I change the numbering of an order list's items?

    How do I get Internet Explorer to do a better job displaying images

    How to add border for html tr

    HTML, CSS: How to override settings from *{}(!important is not working) [closed]

    How to use cookies to change css ?

    How could I use postcss-bem with css-modules or postcss-js in React component

    how do I use the :valid and :invalid selectors for css?

    How to create HTML5 popup with minimize etc

    How to style a parent element when the mouse is over a child element?

    How to make element instantly go back to initial position after CSS animation end?

    why is .show() making the target div appear at top of page?

    How to make layout using css and divs?

    How can I find the css error when I run a jquery plugin on IE8?

    How to set focus/active on the clicked li(tab) in angular.js

    How to ensure CSS :hover is applied to dynamically added element

    How can I add padding to an element on my page?

    How to hide header on scroll down, show on scroll up like linkedin menu

    How can I separate areas with floats from each other?

    How to apply custom css to split post into multiple page

    In HTML, how can I wrap a word at . (dot), just like it wraps at - (dash)?

    How to make gutter between columns in a CSS grid system