SublymeRick SublymeRick - 1 year ago 80
CSS Question

CSS3 IE9 click through pseudo-element?

I have the following fiddle set up with a sample on how to style a select box with CSS3. I'm having trouble in IE9. The

pseudo-elements are preventing the 'click' action of the drop down arrow that they are positioned over. This works in fine in every single browser except IE9. Does anyone have any idea how to tweak this to work? I'm all ears!

P.S. I'm only interested in css ideas. I do not want JavaScript to be a requirement to get this to work correctly.

Answer Source

Use a second select with zero opacity:

    <!DOCTYPE html>
          #real { position: absolute; clip:rect(2px 51px 19px 2px); z-index:2; }
          #fake { position: absolute; opacity: 0; }
          body > span { display:block; position: relative; width: 64px; height: 21px; background: url( right 1px no-repeat; }
        <select id="real">
          <option value="">Alpha</option>
          <option value="">Beta</option>
          <option value="">Charlie</option>
        <select id="fake">
          <option value="">Alpha</option>
          <option value="">Beta</option>
          <option value="">Charlie</option>