国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

18143453325 在線咨詢 在線咨詢
18143453325 在線咨詢
所在位置: 首頁(yè) > 營(yíng)銷資訊 > 建站知識(shí) > 移動(dòng)端HTML5 input常見(jiàn)問(wèn)題(小結(jié))

移動(dòng)端HTML5 input常見(jiàn)問(wèn)題(小結(jié))

時(shí)間:2023-03-03 14:03:01 | 來(lái)源:建站知識(shí)

時(shí)間:2023-03-03 14:03:01 來(lái)源:建站知識(shí)

移動(dòng)端HTML5 input常見(jiàn)問(wèn)題(小結(jié)):

這篇文章主要介紹了移動(dòng)端HTML5 input常見(jiàn)問(wèn)題(小結(jié)),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

1. 去掉input 在iOS中的默認(rèn)圓角和內(nèi)陰影

iOS下 input會(huì)有自帶的圓角和內(nèi)陰影,去掉方法如下:

input{
-webkit-appearance: none;
border-radius: 0;
}

2. 焦點(diǎn)在 input 時(shí),placeholder 沒(méi)有隱藏

input:focus::-webkit-input-placeholder{
opacity: 0;
}

3. input 輸入框調(diào)出數(shù)字鍵盤

單獨(dú)使用type="number"時(shí),iOS調(diào)起的并不是九宮格樣式的數(shù)字鍵盤,如果需要調(diào)起九宮格的數(shù)字鍵盤需要加上 pattern="[0-9]*" 屬性

<!-- 數(shù)字鍵盤 帶有符號(hào),非九宮格樣式 -->
<input type="number"/>

<!-- 九宮格數(shù)字鍵盤 -->
<input type="number" pattern="[0-9]*"/>

<!-- 電話號(hào)碼鍵盤 -->
<input type="tel"/>

4. 搜索時(shí),鍵盤的回車按鈕文字設(shè)定為“搜索”

解決: input 使用 type="search",放在 form 表單內(nèi)。兩者結(jié)合就能使輸入法中的回車按鈕文字變?yōu)?ldquo;搜索”

<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()失效的問(wèn)題

iOS下不能自動(dòng)獲取焦點(diǎn),必須是在監(jiān)聽(tīng)到用戶發(fā)出的事件的函數(shù)中執(zhí)行focus才有用,比如:

// openNotifyReplay 是click觸發(fā)的事件
openNotifyReplay = (e) => {
this.setState({
notifyReplayVisible: true
}, ()=>{
document.getElementById("replayPopupText").focus()
})
}

到此這篇關(guān)于移動(dòng)端HTML5 input常見(jiàn)問(wèn)題(小結(jié))的文章就介紹到這了,更多相關(guān)移動(dòng)端HTML5 input內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

來(lái)源:腳本之家

鏈接:https://www.jb51.net/html5/747016.html

關(guān)鍵詞:小結(jié),移動(dòng)

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點(diǎn)擊下載Chrome瀏覽器
關(guān)閉