Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:22:21+00:00 2026-06-03T10:22:21+00:00

I changed the input file button style with jquery, but i need space between

  • 0

I changed the input file button style with jquery, but i need space between the text input and the button.

How can i do it?

I use this tutorial : http://www.appelsiini.net/projects/filestyle.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:22:22+00:00Added an answer on June 3, 2026 at 10:22 am

    you can edit javascript source code, add some margin-left like me (“margin-left:”8px”),

    try with this:

    /*
     * Style File - jQuery plugin for styling file input elements
     *  
     * Copyright (c) 2007-2008 Mika Tuupola
     *
     * Licensed under the MIT license:
     *   http://www.opensource.org/licenses/mit-license.php
     *
     * Based on work by Shaun Inman
     *   http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom
     *
     * Revision: $Id: jquery.filestyle.js 303 2008-01-30 13:53:24Z tuupola $
     *
     */
    
    (function($) {
    
        $.fn.filestyle = function(options) {
    
            /* TODO: This should not override CSS. */
            var settings = {
                width : 250
            };
    
            if(options) {
                $.extend(settings, options);
            };
    
            return this.each(function() {
    
                var self = this;
                var wrapper = $("<div>")
                                .css({
                                    "width": settings.imagewidth + "px",
                                    "height": settings.imageheight + "px",
                                    "background": "url(" + settings.image + ") 0 0 no-repeat",
                                    "background-position": "right",
                                    "display": "inline",
                                    "position": "absolute",
                                    "overflow": "hidden"
                                    "margin-left:"8px",
                                });
    
                var filename = $('<input class="file">')
                                 .addClass($(self).attr("class"))
                                 .css({
                                     "display": "inline",
                                     "width": settings.width + "px"
                                 });
    
                $(self).before(filename);
                $(self).wrap(wrapper);
    
                $(self).css({
                            "position": "relative",
                            "height": settings.imageheight + "px",
                            "width": settings.width + "px",
                            "display": "inline",
                            "cursor": "pointer",
                            "opacity": "0.0"
                        });
    
                if ($.browser.mozilla) {
                    if (/Win/.test(navigator.platform)) {
                        $(self).css("margin-left", "-142px");                    
                    } else {
                        $(self).css("margin-left", "-168px");                    
                    };
                } else {
                    $(self).css("margin-left", settings.imagewidth - settings.width + "px");                
                };
    
                $(self).bind("change", function() {
                    filename.val($(self).val());
                });
    
            });
    
    
        };
    
    })(jQuery);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I with js or jQuery change input text value with js or
How can I change value of input [button] using parent's id, in jQuery Also,
I have got this button: <input type=button value=Rep id=rep name=rep class=rep style=width:50px onclick=triggerLabel(1);this.disabled=true;addRep(<?php echo
$('input').change(function(){ alert($(this).val()); }); $('input').val(1); This dont work. I need capture the change input with
How can I change checkbox (input) border's style? I've put border:1px solid #1e5180 upon
$(':input[type=text], textarea').change(function(){ if(($(:input[type=text]).val()!=) && $(textarea).val()!=){ $(:submit).removeAttr(disabled); $(:submit).removeClass(disabled); $(:submit).addClass(success); } }); This function is triggered
I'm using a dotLess 'mixin' like this: .base-button-style { ... } .specific-button-style { .base-button-style;
Let's say for example I have this code: <input type=file id=file name=> <input class=uploadarea>
I'm using <input type=file /> in my webpage. I've different CSS classes for button
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.