Hi all - am trying to add a background image to the imput area for file upload for the input fields I have used the below css any solutions will be great.

Thanks in adavance

 #content .input-wide
        width: 288px;
        height: 22px;
        margin: 0;
        padding: 6px 5px 6px 27px;
        -webkit-border-radius: 6px;
        -moz-border-radius: 6px;
        border-radius: 6px;
        border: 1px solid #b4b4b4;
        background: #fff url(/media/library/sprite.png) no-repeat -2px -1px;

            <label for="upload">Upload photo:</label>
            <input class="upload input-wide" name="upload" id="upload" type="file">


Recommended Answers

All 2 Replies

Member Avatar for LastMitch

CSS will not target file type for image upload

Your title doesn't make sense at all?

What are you trying to do? Upload a image and change the how it looks with CSS?

This has to be a weirdest question I read.

Hi LastMitch, sorry for the confusion.

I have a number of input elements using the class input-wide to add a background image to the input fields in a form which are all working (I have only included the one that is not displaying the background image).

All the other input fields have an input type = text where as the input upload has an input type = file and this is the input field that will not display the background image.

Now from the message I had assumed (wrongly) that it may have been the file type that was causing the problem.

Thanks in advance


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.