更改联系表格7中的“选择文件”按钮的文本(WordPress)

时间:2016-12-26 09:10:01

标签: javascript wordpress contact-form-7

文件上传字段由浏览器控制,因此应根据浏览器设置自动翻译。我需要在这个按钮上设置我的语言。我怎么能这样做?

1 个答案:

答案 0 :(得分:1)

我在sitepoint上找到了解决方案。在文件输入名称的 .file-resume 下方,然后修改按钮。

/* Style wrapping span as button */
span.wpcf7-form-control-wrap.file-resume {//FILE-REsume == your name of file input
    display: inline-block;
    position: relative;
    width: 120px;
    height: 40px;
    border-radius: 5px;
    border: solid 1px #11b28e;
    background: gray;     
    color: #FFF;
    overflow:hidden;
}

/* Made input big and move it left and top inside wrapper to hide actual control but leave input clickable */
input.wpcf7-form-control.wpcf7-file {
    position: absolute;
    width: 1500px;
    height: 1000px;
    right: 0;
    bottom: 0;        
    outline: none !important;
}


/* Add button text */
.wpcf7-file:before {
    content: "прикріпити файл";
    display: block;
    width: 120px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    position: absolute;
    right: 0;
    bottom: 0;
    color: #FFF;
    font-size: 16px;
}