我有一个表格,其中有:
<input type="file" size="6" />
不幸的是,该按钮将显示在输入栏中!这是因为我为以下形式的所有输入设置了一个CSS:
#msform input, #msform textarea {
padding: 15px;
border: 1px solid #ccc;
border-radius: 2px;
margin-bottom: 10px;
width: 80%;
height: 29px;
box-sizing: border-box;
font-family: montserrat;
color: #2C3E50;
font-size: 12px;
}
请看一下:http : //jsfiddle.net/kg48vpfq/如何仅清除此输入元素的CSS或更好的方法是如何获取按钮旁边的输入框。
谢谢
添加height: auto
到中file input
。为了共同的风格后,添加这个input
和textarea
。
#fieldset2 input[type="file"] {
height: auto;
border: 0;
}
#msform fieldset:not(:first-of-type) {
display: none;
}
#msform label {
width: 20%;
float: left;
margin-top: 10px;
}
/*inputs*/
#msform input,
#msform textarea {
padding: 15px;
border: 1px solid #ccc;
border-radius: 2px;
margin-bottom: 10px;
width: 80%;
height: 29px;
box-sizing: border-box;
font-family: montserrat;
color: #2C3E50;
font-size: 12px;
}
#msform textarea {
min-height: 100px;
margin-left: 50px;
}
#fieldset2 input[type="file"] {
height: auto;
border: 0;
}
<form id="msform">
<fieldset id="fieldset2">
<input type="file" size="6" />
</fieldset>
</form>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句