您好,登錄后才能下訂單哦!
這篇文章主要為大家詳細(xì)介紹了用純css實(shí)現(xiàn)input[type=file]的樣式控制,文中示例代碼介紹的非常詳細(xì),零基礎(chǔ)也能參考此文章,感興趣的小伙伴們可以參考一下。
代碼如下:
<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> .fileContainer { overflow: hidden; position: relative; } .fileContainer [type=file] { cursor: inherit; display: block; font-size: 999px; filter: alpha(opacity=0); min-height: 100%; min-width: 100%; opacity: 0; position: absolute; right: 0; text-align: right; top: 0; } /* Example stylistic flourishes */ .fileContainer { background: red; border-radius: .5em; float: left; padding: .5em; } .fileContainer [type=file] { cursor: pointer; } } </style> </head> <body> <label class="fileContainer"> 點(diǎn)擊這里實(shí)現(xiàn)文件上傳! <input type="file"/> </label> </body> </html>
看完上述內(nèi)容,你們掌握用純css實(shí)現(xiàn)input[type=file]的樣式控制的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。