search

Home  >  Q&A  >  body text

css3 - 如何使用css将select的边框以及右边的小三角形去掉?

最好css2,css3都给出解决方案,效果如下:

大家讲道理大家讲道理2863 days ago691

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 11:22:02

    CSS2 can only be simulated using p and ul. The structure is very simple. For details, please refer to Alice's button-dropdown
    CSS3. You can use the CSS3 attribute appearance. The specific code is as follows:

    select{
        -moz-appearance: none;
        -webkit-appearance:none;
                appearance:none;  
    }

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:22:02

    Unfortunately, the default style of native form elements is controlled by browser customization, and there is no standard to follow. Different browsers allow you to make varying degrees of modification, but a completely reliable cross-browser solution does not exist. So what the person above said is right, if you want to ensure the consistency of the UI, you can only simulate one yourself.

    The following code will be valid on chrome and firefox (but the version coverage is not complete)

    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;

    However, other browsers don’t know.

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:22:02

    Why remove it? Simulate a spread.

    reply
    0
  • Cancelreply