CSS Button has a border

前端 未结 7 454
旧巷少年郎
旧巷少年郎 2021-01-23 21:58

I am trying to define a custom css button for my search form. I cant figure out why this particular button has a strange border around it? I need to get it removed but cannot

相关标签:
7条回答
  • 2021-01-23 22:30

    Looks like solutions requiring a different html structure work for you. But to answer the original question, here's the css solution for getting a button to respect your custom styles:

    button {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        padding: 0;
        border: 0;
    }
    

    This tells Safari and Chrome (webkit), Firefox (moz), and standards-compliant browsers to not enforce their default button styles, and then makes sure there's no padding or border.

    0 讨论(0)
提交回复
热议问题