Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I 'send an image back', behind textboxes?

You can view my problem:

enter image description here

http://i.stack.imgur.com/cGoEU.png

That image is covering my login form. How do I get it to move behind the textboxes & sign in button?

This is my code:

<img src="C:\Users\George\Documents\HTML\My Local Soccer\pics\icons\gradient box.gif" 
    style="position:absolute; top: 155px; left: 480px; width:auto; height:auto;">
<input type="text" class="tb7" value="Username" style="margin-left: 563px" 
    maxlength="20" onfocus="if(this.value == 'Username') {this.value='';}" />         
</br>
<input type="text" class="tb8"  value="Password" style="margin-left: 563px;"   
    maxlength="20" onfocus="if(this.value =='Password') {this.value='';}"/>
<input type="image" height="25px"   width="67px" style="vertical-align:top;"
    src="C:\Users\George\Documents\HTML\My Local Soccer\pics\icons\sign in.gif" />
like image 224
George Bălan Avatar asked Jul 15 '12 01:07

George Bălan


4 Answers

The easiest way to do this is through CSS' z-Index. Basically what it does it define the stacked location of elements. The higher the number, the more on top it is of other elements. Since you did not provide the top HTML for these input fields, I cannot give you a concrete example on how to do this, but I would be happy to help you further if you provide more code.

like image 32
Battle_707 Avatar answered Oct 14 '22 06:10

Battle_707


wrap inputs in a div and and style it with the image in background.

like image 25
Raab Avatar answered Oct 14 '22 08:10

Raab


Try:

<div id="form_wrapper" style="background-image:url('img/yellow.png');">
<img src="C:\Users\George\Documents\HTML\My Local Soccer\pics\icons\gradient box.gif" 
    style="position:absolute; top: 155px; left: 480px; width:auto; height:auto;">
<input type="text" class="tb7" value="Username" style="margin-left: 563px" 
    maxlength="20" onfocus="if(this.value == 'Username') {this.value='';}" />         
</br>
<input type="text" class="tb8"  value="Password" style="margin-left: 563px;"   
    maxlength="20" onfocus="if(this.value =='Password') {this.value='';}"/>
<input type="image" height="25px"   width="67px" style="vertical-align:top;"
    src="C:\Users\George\Documents\HTML\My Local Soccer\pics\icons\sign in.gif" />
</div>

Enjoy and good luck!

like image 33
Daniel Li Avatar answered Oct 14 '22 08:10

Daniel Li


Try with style="z-index:-5;" and position relative or absolute

like image 51
Borgtex Avatar answered Oct 14 '22 07:10

Borgtex