HTML5如何去掉輸入框type為number時(shí)的上下箭頭

小編給大家分享一下HTML5如何去掉輸入框type為number時(shí)的上下箭頭,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

成都創(chuàng)新互聯(lián)公司是工信部頒發(fā)資質(zhì)IDC服務(wù)器商,為用戶提供優(yōu)質(zhì)的成都IDC機(jī)房托管服務(wù)

html5中,input type="number"時(shí) 右邊會(huì)有一個(gè)上下小箭頭,介紹去掉這個(gè)箭頭的方法,完成瀏覽器的兼容,頁面效果的統(tǒng)一

HTML5如何去掉輸入框type為number時(shí)的上下箭頭

一。公共樣式

<!DOCTYPE html>
<html>
 <head>
  <meta charset="UTF-8">
  <title>去掉輸入框type為number時(shí)的上下箭頭</title>
  <style>
   /*谷歌*/
   input::-webkit-outer-spin-button,
   input::-webkit-inner-spin-button {
    -webkit-appearance: none;
   }
   /*火狐*/
   input[type="number"] {
    -moz-appearance: textfield;
   }
  </style>
 </head>
 <body>
  <input type="number" ...>
 </body>
</html>

二。專用樣式

<!DOCTYPE html>
<html>
 <head>
  <meta charset="UTF-8">
  <title>去掉輸入框type為number時(shí)的上下箭頭</title>
  <style>
   /*在谷歌下移除input[number]的上下箭頭*/
   .inputNumber input[type='number']::-webkit-outer-spin-button,
   .inputNumber input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0;
   }
   /*在firefox下移除input[number]的上下箭頭*/
   .inputNumber input[type="number"] {
    -moz-appearance: textfield;
   }
  </style>
 </head>
 <body>
  <input type="number" class="inputNumber" placeholder="請輸入電話號(hào)碼"> 1
 </body>
</html>

看完了這篇文章,相信你對“HTML5如何去掉輸入框type為number時(shí)的上下箭頭”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

標(biāo)題名稱:HTML5如何去掉輸入框type為number時(shí)的上下箭頭
文章URL:http://muchs.cn/article20/ippsjo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序自適應(yīng)網(wǎng)站、網(wǎng)站導(dǎo)航、網(wǎng)站營銷、品牌網(wǎng)站建設(shè)、建站公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作