Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 编辑文件输入标记,使其以某种方式显示_Css - Fatal编程技术网

Css 编辑文件输入标记,使其以某种方式显示

Css 编辑文件输入标记,使其以某种方式显示,css,Css,我有一个文件输入按钮设计(这是第二个说上传的按钮),我如何使用CSS和或Javascript在HTML中完成这个设计 好,试试这个: html: js: 我已重新编写了问题,您应该提供您尝试过的内容 <p class="form"> <input type="text" id="path" /> <label class="uploadFile">upload<span><input type="file" id="myfil

我有一个文件输入按钮设计(这是第二个说上传的按钮),我如何使用CSS和或Javascript在HTML中完成这个设计

好,试试这个:

html:

js:


我已重新编写了问题,您应该提供您尝试过的内容
<p class="form">
    <input type="text" id="path" />
    <label class="uploadFile">upload<span><input type="file" id="myfile" name="myfile" /></span>
</label>
</p>
.form input[type="file"]{
    z-index: 999;
    line-height: 0;
    font-size: 50px;
    position: absolute;
    opacity: 0;
    filter: alpha(opacity = 0);-ms-filter: "alpha(opacity=0)";
    cursor: pointer;
    _cursor: hand;
    margin: 0;
    padding:0;
    left:0;
}

.uploadFile{
    position:relative;
    overflow:hidden;
    cursor:pointer;
    text-align:center;
    background-color:#fff;
    display:block;
    width:197px;
    height:31px;
    font-size:18px;
    line-height:30px;
    float:left;
    color:#000;
    border:solid 1px #000;
}
input[type="text"]{
border: none;
position: absolute;
top: 50px;
width: 200px;
}
$('#myfile').change(function(){
        $('#path').val($(this).val());
    });

$(function(){
    if($("#path").val() == ""){
        $("#path").val("No file choosen");
    }
});