Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move img src a few pixels down in html page

Tags:

html

css

I found a way to make my own custom file upload control , by placing a fake control over it, and when i click the fake one , i am actually cliking the real control below.

Anyways the image for the browse button is a little to the top.

How can i lower it down a little?

Here is the js fiddle.

JsFiddle

Here is the html and css:

    <div>
    <div class="fileinputs">
        <input type="file" class="file" />
        <div class="fakefile">
            <input />
            <img src="search.jpg" />
        </div>
    </div>
</div>

div.fileinputs {
position: relative;
}
div.fakefile {
position: absolute;
top: 0px;
left: 0px;
z-index: 1;
}
input.file {
position: relative;
text-align: right;
-moz-opacity:0;
filter:alpha(opacity: 0);
opacity: 0;
z-index: 2;
}
like image 475
user3816931 Avatar asked Nov 29 '22 15:11

user3816931


1 Answers

I believe this is what you are looking for. jsFiddle

CSS

.moveimage
{
    position: relative;
    top: 3px;
}

Modified HTML

<img class="moveimage" src="search.jpg" />
like image 168
Bijan Avatar answered Dec 01 '22 04:12

Bijan