css上传图片

作者:Jasmine - 2017年07月11日
<div class="sendImage">
     上传图片
    <input type="file" class="imageFile" name="imageFile">
 </div>
.sendImage{ position: relative;
    min-width: 48px;
    padding: 0 12px;
    height: 26px;
    line-height: 26px;
    font-size: 12px;
    display: inline-block;
    cursor: pointer;
    text-align: center;
    font-weight: 400;
    white-space: nowrap;
    vertical-align: middle;
    border: solid 1px #5193b6;
    background-color: #fff;
    color: #5193b6;
    border-color: #5193b6;
    border-radius: 3px;
    -webkit-transition: background-color .1s linear;
    -moz-transition: background-color .1s linear;
    -o-transition: background-color .1s linear;
    transition: background-color .1s linear; cursor: pointer;}
.sendImage:hover{color: #fff; background-color: #5193b6; border-color: #5193b6;}
.imageFile{position:absolute;bottom:0;left:0; width:100%; height:100%; font-size:100px;z-index:1;opacity:0;filter:alpha(opacity=0); cursor: pointer;    text-indent: -9999px;}


效果:

本文作者: Jasmine

本文链接: https://www.jianbaizhan.com/article/560

版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!


 请勿发布不友善或者负能量的内容。审查将对发布广告等违规信息进行处罚!