Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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
Html 如何设置文件输入的样式?_Html_Css - Fatal编程技术网

Html 如何设置文件输入的样式?

Html 如何设置文件输入的样式?,html,css,Html,Css,好的,我得到了以下信息: 我想做的是,使显示“Elegir archivos”的按钮变成橙色,就像显示“Finalizar”的按钮一样,并使文件输入生成的文本变成灰色,就像显示“Formatos aceptados”的文本一样。 以下是我尝试过的: <tr> <td class="upload-pic"><input class="file-submit" type="file" name="file

好的,我得到了以下信息:

我想做的是,使显示“Elegir archivos”的按钮变成橙色,就像显示“Finalizar”的按钮一样,并使文件输入生成的文本变成灰色,就像显示“Formatos aceptados”的文本一样。 以下是我尝试过的:

       <tr>
                        <td  class="upload-pic"><input class="file-submit" type="file" name="fileUpload" size="50" multiple="multiple"/></td>
       </tr>

我想要的是:显示“Elegir archivos”的按钮必须是橙色,文本为白色。旁边的文字写着“No se eligio archivo”必须是灰色的,背景是白色的。由于某种原因,所有内容都会出现在一个大的橙色框中,并且按钮看起来仍然像默认的按钮。

基本上问题是,浏览器不知道您希望它是橙色的。因为您的文件说它是一个按钮,所以它将默认的HTML按钮样式应用于它。为了澄清这一点,在CSS中,您只需说:

tr td input.file-submit {
  text-decoration: none; 
  color: #ffffff; 
}
然后,只需将文本的颜色更改为#848D95

好了。完成了


希望这有帮助

为了实现这一点,您可以用“标签”包装输入按钮,这样标签就可以点击了。然后使输入按钮不透明度为0(透明)

$('.file submit')。在('change',function()上{
$(this).closest('.btn wrapper').find('span'))
.text('FOTOS Formatos aceptados:JPG');
})
.btn包装器{
字体系列:“阳台”,无衬线;
}
.btn文件{
填充:8px 15px;
背景色:#fd8907;
边界半径:3px;
颜色:#fff;
右边距:8px;
}
.btn文件输入[类型=文件]{
位置:绝对位置;
排名:0;
右:0;
最小宽度:100%;
最小高度:100%;
字体大小:100px;
文本对齐:右对齐;
过滤器:alpha(不透明度=0);
不透明度:0;
大纲:无;
背景:白色;
游标:继承;
显示:块;
}
.btn文件跨度{
显示:块;
颜色:#777;
}

埃列吉尔·阿奇沃斯
不,我是eligio archivo

我还创建了一个可能的副本,请更简洁地说明您想要的内容。@ArihanSharma刚刚更新了我的问题。这只会使说明选择了哪个文件的文本消失。我想要该文本,但该文本位于按钮旁边,灰色背景,白色背景。请查看我修订的编辑,可能会有所帮助(我希望如此)。如果您想显示选择了多少文件:
tr td input.file-submit {
  text-decoration: none; 
  color: #ffffff; 
}