css解决ios端按钮和输入框自带圆角的问题

请在这里查看示例 borderRadius示例

问题重现

在ios端,我们不想使用按钮或输入框自带的圆角样式,改如何取消呢?

问题解决
  • -webkit-appearance : none ;/解决ios上按钮的圆角问题/
  • border-radius: 0;/解决ios上输入框圆角问题/
  • ios端示例截屏如下:
    这里写图片描述
示例源码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>demo</title>
<style>
    * {  
        margin: 0;   
        padding: 0;  
    }  
    body, html {  
        width: 100%;  
        height: 100%;
    }
    button, input {
        width: 90%;
        margin: 0 auto;
        display: block;
        box-sizing: border-box;
        height: 50px;
        line-height: 50px;
    }
    .bBtn {
        -webkit-appearance : none ;/*解决ios上按钮的圆角问题*/
    }
    .bInput {
        border-radius: 0;/*解决ios上输入框圆角问题*/
    }
</style>
</head>
<body>
    <button class="aBtn">ios这个按钮有圆角</button>
    <button class="bBtn">ios这个按钮没有圆角</button>
    <input class="aInput" type="text" placeholder="ios这个输入框有圆角"/>
    <input class="bInput" type="text" placeholder="ios这个输入框没有圆角"/>
</body>
</html>
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值