帝王谷资源网 Design By www.wdxyy.com
1. 去掉input 在iOS中的默认圆角和内阴影
iOS下 input会有自带的圆角和内阴影,去掉方法如下:
input{ -webkit-appearance: none; border-radius: 0; }
2. 焦点在 input 时,placeholder 没有隐藏
input:focus::-webkit-input-placeholder{ opacity: 0; }
3. input 输入框调出数字键盘
单独使用type="number"时,iOS调起的并不是九宫格样式的数字键盘,如果需要调起九宫格的数字键盘需要加上 pattern="[0-9]*" 属性
<!-- 数字键盘 带有符号,非九宫格样式 --> <input type="number"/> <!-- 九宫格数字键盘 --> <input type="number" pattern="[0-9]*"/> <!-- 电话号码键盘 --> <input type="tel"/>
4. 搜索时,键盘的回车按钮文字设定为“搜索”
解决: input 使用 type="search",放在 form 表单内。两者结合就能使输入法中的回车按钮文字变为“搜索”
<form action=""> <input type="search" /> </form>
5. 改变input placeholder颜色
::-webkit-input-placeholder { /* WebKit browsers */ color: #999; } :-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: #999; opacity: 1; } ::-moz-placeholder { /* Mozilla Firefox 19+ */ color: #999; opacity: 1; } :-ms-input-placeholder { /* Internet Explorer 10+ */ color: #999; } input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { /* WebKit*/ color: #666; } input:-moz-placeholder, textarea:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: #666; } input::-moz-placeholder, textarea::-moz-placeholder { /* Mozilla Firefox 19+ */ color: #666; } input:-ms-input-placeholder, textarea:-ms-input-placeholder { /* IE 10+ */ color: #666; }
6. iOS下autofocus focus()失效的问题
iOS下不能自动获取焦点,必须是在监听到用户发出的事件的函数中执行focus才有用,比如:
// openNotifyReplay 是click触发的事件 openNotifyReplay = (e) => { this.setState({ notifyReplayVisible: true }, ()=>{ document.getElementById("replayPopupText").focus() }) }
标签:
移动端,HTML5,input
帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com
暂无评论...
更新日志
2024年06月26日
2024年06月26日
- 瑞鸣音乐《中国音乐地图之听见河南豫剧经典唱段》2020[WAV分轨]
- 【伊比萨沙发】VA-2024-IbizaSpring2024(LoungeCocktailsfromtheHeart)[FLAC]
- 群星《世界顶级汽车音响试音王》4K金碟16CD[WAV+CUE]
- 群星-音效环绕天碟《极致环绕人声天碟天品》7CD[WAV]
- 泰拉克SACD古典试音碟7SACD-ISO
- 群星《红歌宝典》20CD[WAV/分轨]
- 《101系列:好歌101首 细听年代精选》[WAV+CUE][3.6GB]
- 《101系列 6CD 国语经典101首歌曲 张学友 王菲代表作》[APE+CUE][2.8GB]
- 《101系列:国语经典101 VOL2 6CD 精选最经典101首》[WAV+CUE][2.3GB]
- 群星《十年网络红歌》15CD[WAV分轨]
- 宝丽金-环球10周年至50周年经典金曲15CD[低速原抓WAV+CUE]
- FIM唱片《十大男伶》[低速原抓WAV+CUE]
- 《101系列:情歌101 6CD》[WAV+CUE][3.1GB]
- 庄心妍《降调版合集》[320K/MP3][52.96MB]
- 庄心妍《降调版合集》[FLAC/分轨][118.78MB]