SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    styling an input type=file element

    This is the code:

    <input type="file" name="uplo">

    In Internet Explorer, it generates an input field plus a button. Clicking the button will allow you to select a file from your computer.
    It is possible to put some style to the input-field like <input type="file" name="uplo" style='background-color: lime;'> but this only affects the generated inputfield, not the generated button.
    The problem is that this type of <input> generates two input-elements on your page, but that you can only style the first element with css.
    Anyone knows how to style the button (without using classes)?

  2. #2
    SitePoint Wizard Mincer's Avatar
    Join Date
    Mar 2001
    Location
    London | UK
    Posts
    1,140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyway, I don't think you can style the button and text box separately. I've managed to style the borders and the background of the textbox, but not the button colour.

    EDIT: In fact, if you look at the file upload for attachments on this very forum, you'll notice that they've done exactly the same styling. The button is still the default colour rendered by the browser.
    Last edited by Mincer; Oct 16, 2002 at 07:25.

  3. #3
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just as I thought, but you know, we're on the world wide web and someone out there maybe has an answer to my problem...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •