請在這裏查看示例 ☞ 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>