<legend id='C3EGC'><style id='C3EGC'><dir id='C3EGC'><q id='C3EGC'></q></dir></style></legend>
    • <bdo id='C3EGC'></bdo><ul id='C3EGC'></ul>

    1. <i id='C3EGC'><tr id='C3EGC'><dt id='C3EGC'><q id='C3EGC'><span id='C3EGC'><b id='C3EGC'><form id='C3EGC'><ins id='C3EGC'></ins><ul id='C3EGC'></ul><sub id='C3EGC'></sub></form><legend id='C3EGC'></legend><bdo id='C3EGC'><pre id='C3EGC'><center id='C3EGC'></center></pre></bdo></b><th id='C3EGC'></th></span></q></dt></tr></i><div id='C3EGC'><tfoot id='C3EGC'></tfoot><dl id='C3EGC'><fieldset id='C3EGC'></fieldset></dl></div>
    2. <small id='C3EGC'></small><noframes id='C3EGC'>

    3. <tfoot id='C3EGC'></tfoot>
      1. HTML 文件上传“未选择文件"文字样式

        HTML file upload quot;no file selectedquot; text style(HTML 文件上传“未选择文件文字样式)
      2. <tfoot id='VYG8V'></tfoot>

          1. <i id='VYG8V'><tr id='VYG8V'><dt id='VYG8V'><q id='VYG8V'><span id='VYG8V'><b id='VYG8V'><form id='VYG8V'><ins id='VYG8V'></ins><ul id='VYG8V'></ul><sub id='VYG8V'></sub></form><legend id='VYG8V'></legend><bdo id='VYG8V'><pre id='VYG8V'><center id='VYG8V'></center></pre></bdo></b><th id='VYG8V'></th></span></q></dt></tr></i><div id='VYG8V'><tfoot id='VYG8V'></tfoot><dl id='VYG8V'><fieldset id='VYG8V'></fieldset></dl></div>

                <tbody id='VYG8V'></tbody>
                <bdo id='VYG8V'></bdo><ul id='VYG8V'></ul>

                  <small id='VYG8V'></small><noframes id='VYG8V'>

                  <legend id='VYG8V'><style id='VYG8V'><dir id='VYG8V'><q id='VYG8V'></q></dir></style></legend>

                  本文介绍了HTML 文件上传“未选择文件"文字样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在构建一个需要文件上传的 html 表单.当我让文件上传部分工作时,我无法获得表单上传按钮的样式和未选择文件"文本.

                  I am building a html form that needs file upload. While I got the file upload part working, I am unable to get the styling of form upload button and " No file selected" text.

                  我想要的标记是

                  有办法吗?

                  PS:请忽略绿色文字(上传屏幕截图").我有那个工作.

                  PS: Please ignore the green text ( "Upload a screen shot"). I have that working.

                  按钮的当前行为和未选择文件"在同一行.

                  Current behavior the button and the "no file chosen" is in the same line.

                  HTML 代码:

                  <div class="formField">
                     <label for="fileToUpload">Upload a screen shot (optional) </label>
                     <input type="file" name="fileToUpload" id="fileToUpload"/> 
                  </div>
                  

                  推荐答案

                  文件输入不能单独使用 CSS 设置样式.您需要使用一个 jQuery 插件来制作一个可以使用 CSS 设置样式的自定义文件上传按钮.

                  File inputs can't be styled with CSS alone. You'll need to use a jQuery plugin that makes a custom file upload button that can be styled with CSS.

                  一个很好的叫做 NiceFileInput.

                  使用方法:

                  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
                  <script src="/your_path/jquery.nicefileinput.min.js"></script>
                  

                  从这里下载文件.p>

                  2.将其绑定到您想要的元素.这会将其绑定到所有文件输入:

                  <script type="text/javascript">
                  $(document).ready(function() {
                      $("input[type=file]").nicefileinput();
                  });
                  </script>
                  

                  3.用 CSS 自定义它

                  .NFI-wrapper {
                      // the container div
                  }
                  .NFI-button {
                      // the button div element
                  }
                  .NFI-filename {
                      // the text input element which collects and shows the value
                  }
                  

                  这篇关于HTML 文件上传“未选择文件"文字样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                  How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)
                  YouTube iframe player API - OnStateChange not firing(YouTube iframe 播放器 API - OnStateChange 未触发)
                  Apply jquery (mobile) css classes programatically after rendering has occurred(呈现后以编程方式应用 jquery (mobile) css 类)
                  How to avoid name clashes in JavaScript widgets(如何避免 JavaScript 小部件中的名称冲突)
                  Where can I find a list of icon images for the dojo toolkit dijit widgets?(在哪里可以找到 dojo 工具包 dijit 小部件的图标图像列表?)
                  1. <i id='tEBZn'><tr id='tEBZn'><dt id='tEBZn'><q id='tEBZn'><span id='tEBZn'><b id='tEBZn'><form id='tEBZn'><ins id='tEBZn'></ins><ul id='tEBZn'></ul><sub id='tEBZn'></sub></form><legend id='tEBZn'></legend><bdo id='tEBZn'><pre id='tEBZn'><center id='tEBZn'></center></pre></bdo></b><th id='tEBZn'></th></span></q></dt></tr></i><div id='tEBZn'><tfoot id='tEBZn'></tfoot><dl id='tEBZn'><fieldset id='tEBZn'></fieldset></dl></div>
                        <tbody id='tEBZn'></tbody>
                      <legend id='tEBZn'><style id='tEBZn'><dir id='tEBZn'><q id='tEBZn'></q></dir></style></legend>

                        <small id='tEBZn'></small><noframes id='tEBZn'>

                          <tfoot id='tEBZn'></tfoot>
                            <bdo id='tEBZn'></bdo><ul id='tEBZn'></ul>