开发者

how to add space between textbox and browse button for input file type

开发者 https://www.devze.com 2023-03-29 02:43 出处:网络
Can we add space between the browse button and textbox for input type file ?I开发者_开发技巧s that possible? Aslo can i add border color for the sametextbox ?

Can we add space between the browse button and textbox for input type file ?I开发者_开发技巧s that possible? Aslo can i add border color for the same textbox ?

thanks,

michaeld


Increasing spacing is not possible. Generally speaking, styling an input type="file" is extremely difficult. If you check cross-browser, you can see that different browsers render it differently. The only way to style it is to fake another element as input type="file"

Example: http://www.quirksmode.org/dom/inputfile.html


You should use css to do this: Your html:

    <input type="text" class="yourclass" name="yourname" />
    <input type="submit" />

your css:

    <style> input.yourclass { border:1px solid red; margin-right: 10px;} </style>

Hope this puts you in the right direction


It is working for me in Chrome.

input.file {
    text-indent: initial;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号