美文网首页
<input_file>美化

<input_file>美化

作者: 程小E | 来源:发表于2017-02-25 15:20 被阅读37次

主要思路

在<input_file>标签上套a标签,文字写在<input_file>外a标签内,把<input_file>的设置为透明,绝对定位在a标签上,设置font-size:100px;是扩大<input_file>的选择范围,相应的a标签需要设置overflow:hidden;等样式

直接上代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        a{
            display:inline-block; 
            width:100px; 
            height:40px; 
            background:red; 
            position:relative; 
            overflow:hidden;
            text-align: center;
            text-decoration: none;
            line-height: 40px
        }
        a:hover{
            background:green;
        }
        input{
            position:absolute; 
            right:0; 
            top:0; 
            font-size:100px; 
            opacity:0; 
            filter:alpha(opacity=0);
        }
    </style>

</head>
<body>
    <a href="#">
    打开文件
        <input type="file" value="浏览" />
    </a>

</body>
</html>

相关文章

  • <input_file>美化

    主要思路 在 标签上套a标签,文字写在 外a标签内,把 的设置为透明,绝对定位在a标签上,设置font-size:...

  • Read a story

    This is a lion. lt's big. lt's strong. lt has big teeth. ...

  • Mybatis中特殊符号转移

    1. 写法1 原符号替换符号<<<=<=>>>=>=<><>&&'&a...

  • Read a story

    lt's hot?? lt's cool here. lt's a hat. What's this? Do yo...

  • test

    <script>alert(1);</script>

  • 无标题文章

    <script>alert('hello’);</script>

  • 芯科通信招聘fw固件工程师

    职责描述 工作职责:lt;/pgt;lt;pgt;1、负责光模块firmware的软件设计、维护以及优化;lt;/...

  • 打卡第47天

    Attention is vitality. lt connects you with others. lt ma...

  • Listen and enjoy

    lt can be bitter. lt can be sweet. Sometimes it's black. ...

  • 2018-10-08

    线性系统的LT分析法一、数学角度1、对微分方程进行LT分析eg:同求LT变换得到2、对电路进行LT处理对于线性电路...

网友评论

      本文标题:<input_file>美化

      本文链接:https://www.haomeiwen.com/subject/wgxnwttx.html