關與模擬html的input的file屬性的方法

代碼如下:

<html>

<head>

<style>

.centre_upload {
display: inline-block;
  /*塊內連*/
text-decoration: underline; /*文字下劃線*/
color: rgb(20,95,150); /*字體顏色*/
position: relative; /*相對定位*/
cursor: pointer; /*手型鼠標*/
vertical-align: middle; /*與對象中部對齊*/
}
.file {
position:absolute; /*絕對定位*/
display:inline-block; /*塊內連*/
filter: Alpha(Opacity=0); /*通過濾鏡設置透明度*/
opacity:0; /*設置透明度*/
top:0px; /*與對象的頂部距離*/
right:0px; /*與對象的右邊距離*/
cursor:pointer; /*手型鼠標*/

}

</style>

</head>

<body>

<a class="centre_upload">點擊上傳<input type="file" class="file" /></a>

<body>

</html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章