css - 联系表格 7 中的样式输入文件

标签 css wordpress contact-form

我正在尝试用我在 fiddle 中设计的现代文件替换旧的输入文件。但是,由于我使用的是 WP 联系表 7,因此它已集成到主题中,我可以编辑它的唯一方法是通过此代码 -

<label>  
    [text* your-name placeholder "Your Name (required)"] </label>

<label>  
    [email* your-email placeholder "Your email (required)"] </label>

<label> 
    [text your-subject placeholder "Subject"] </label>

<label> 
    [textarea your-message placeholder "Your Message"] </label>
[file file-442 limit:10485760 filetypes:doc|pdf|csv class:cv]

[submit "AHOI!"]

那么有没有办法用我的输入替换文件所在的最后一个输入并隐藏原始输入?这是我的输入

input[type="file"] {
  display: none;
}

.custom-file-upload {
  border: 1px solid currentColor;
  color: #083a50;
  cursor: pointer;
  display: inline-block;
  font-weight: bold;
  line-height: 1;
  padding: 0.5em 2em 0.25em 1em;
  user-select: none;
}

.upload {
  height: 1.75em;
  margin-right: 0.5em;
  padding-bottom: 0.25em;
  width: auto;
  vertical-align: middle;
}
<label for="file-upload" class="custom-file-upload">
    <img class="upload"src="http://www.plaforma.me/wp-content/uploads/2018/04/SEND-FILE-IKONICA.png" width="300" height="53" alt=""> Select File
</label>
<input id="file-upload" type="file" />

不知道为什么这里没有在文本旁边加载图标但有图标,所以有人知道我如何替换联系表 7 中的原始图标吗?

最佳答案

对于样式,文件输入类型 http://markusslima.github.io/jquery-filestyle图书馆非常好。

$(":file").jfilestyle({input: false, text: "Select File"});

另请参阅此处的选项。 http://markusslima.github.io/jquery-filestyle/options.html

关于css - 联系表格 7 中的样式输入文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52664002/

相关文章:

PHP 联系表未提交

php - 通过联系表单Submission.php接收500服务器错误

html - 手机无法点击链接

html - 如何在鼠标悬停在所有内容之上时将图像设置为 div?

php - WooCommerce 中新订单电子邮件通知的自定义主题

JavaScript。等待嵌套的获取 promise

php - 联系表单电子邮件中主题的 UTF-8 编码

css - 盒子阴影在 Chrome 和 Firefox 中的不同行为

css - LESS CSS - Mixin Arguments 和 Nth-Child - 没有循环

wordpress - 如何阻止 x-robots-tag 在我的整个站点上设置 noindex?