0

Im trying to align (reletive towards eachothers horizontal center) my image button with an input box but cant get it working.. all the examples I have seen online make use of a single image rather then a rollover image setup...

<body background="Images/Main_Background.png"> 

<center>
<a href="#"
   onclick="this.href = ('file:///V:/' + document.getElementById('prog_site').value + '/Tekeningen/Tekenwerk De Mar/Definitief/' + document.getElementById('prog_site').value + '.pdf' )"
   target="upper">

    <img src="Images/Zoek.png" border="0" alt="Form" width="40" height="40"
         onmouseover="this.src='Images/Zoek_Rollover.png'"
         onmouseout="this.src='Images/Zoek.png'"><input type="text" name="prog_site" id="prog_site" value="" /></Center>
    </img>

</body>
1
  • A working JSFiddle would be very useful Commented Nov 19, 2013 at 13:18

2 Answers 2

1

Try something like: Fiddle

div.cont {
    text-align: center;
    line-height: 40px;
}
.cont img, .cont input{
    vertical-align: middle;
}
Sign up to request clarification or add additional context in comments.

Comments

0

You have some syntax errors:

  • Missing closing tag for a
  • img tag is self-closed tag

Also what's the problem? Image and input is aligned to each other. Some tips I think may help you:

  • Add line-height: css attribute for center tag to max height of it's elements. In this case 40px - image's height. ...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.