您的位置:首页 > Web前端 > CSS

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

2016-12-29 14:29 519 查看
请在这里查看示例 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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios css