set width to the< Input type=file>

Posted on 2011-10-14
Last Modified: 2012-05-12
I have button on top of <input type=fie>. I need to set the width to the input type=file as similar to button width. Is there anyway do it.
Code snippet:
  <input type="button" name="Done" value="Choose a Pic" class="button small primary"/>
                <input type="file" name="files" id="imageFile" class="buttonUpload button small primary">
Css is written to made the opacity:0 to imageFile.

Issue here is width is not getting equal between button and input file type?
Question by:gaurih
    LVL 40

    Expert Comment


    Author Comment

    I followed this example, but I am able to clcik even outside of the button, since the background is with opacity:0. I need to control that based on the image on the front.

    Author Comment

    is there any way in css3 with jquery?

    Author Comment

    Can any one please help to compare the size of the textfield in input type=file and width of the button?
    LVL 40

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery ( 1.6 introduces .prop() ( and .removeProp() ( methods which allow modifying or removi…
    Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now