Styling input buttons for iPad and iPhone

前端 未结 6 1306
一个人的身影
一个人的身影 2020-11-28 00:49

I\'m using CSS to style the input buttons on my website, but on IOS devices the styling is replaced by Mac\'s default buttons. Is there a way to style buttons for iOS, or a

相关标签:
6条回答
  • 2020-11-28 01:10

    I recently came across this problem myself.

    <!--Instead of using input-->
    <input type="submit"/>
    <!--Use button-->
    <button type="submit">
    <!--You can then attach your custom CSS to the button-->
    

    Hope that helps.

    0 讨论(0)
  • 2020-11-28 01:19

    You may be looking for

    -webkit-appearance: none;
    
    • Safari CSS notes on -webkit-appearance
    • Mozilla Developer Network's -moz-appearance
    0 讨论(0)
  • 2020-11-28 01:19

    -webkit-appearance: none;

    Note : use bootstrap to style a button.Its common for responsive.

    0 讨论(0)
  • 2020-11-28 01:20

    I had the same issue today using primefaces (primeng) and angular 7. Add the following to your style.css

    p-button {
       -webkit-appearance: none !important;
    }
    

    i am also using a bit of bootstrap which has a reboot.css, that overrides it with (thats why i had to add !important)

    button {
      -webkit-appearance: button;
    

    }

    0 讨论(0)
  • 2020-11-28 01:23

    Use the below css

    input[type="submit"] {
      font-size: 20px;
      background: pink;
      border: none;
      padding: 10px 20px;
    }
    .flat-btn {
      -webkit-appearance: none;
      -moz-appearance: none;
       appearance: none;
       border-radius: 0;
    }
    
    h2 {
      margin: 25px 0 10px;
      font-size: 20px;
    }
    <h2>iOS Styled Button!</h2>
    <input type="submit" value="iOS Styled Button!" />
    
    <h2>No More Style! Button!</h2>
    <input class="flat-btn" type="submit" value="No More Style! Button!" />

    0 讨论(0)
  • 2020-11-28 01:25

    Please add this css code

    input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    }
    
    0 讨论(0)
提交回复
热议问题