开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜