Solved

Line up input box with gif submit button.

Posted on 2003-11-21
6
964 Views
Last Modified: 2007-12-19
Hi,

How can i get the input box and gif submit in line in this code. As it is the gif appears too high.

<FORM action=/cgi-bin/lance/search.cgi method=get>

<INPUT
      style="BORDER-RIGHT: #066c9f 1px solid; BORDER-TOP: #066c9f 1px solid; BORDER-LEFT: #066c9f 1px solid; BORDER-BOTTOM: #066c9f 1px solid; BACKGROUND-COLOR: #ecf1f5"
      onfocus=this.select() size=14 value="Find Find" name=keywords>

<INPUT
      type=image height=30 alt=Search width=22
      src="refferals_files/search.gif" value=Submit border=0 name=go2>
      </FORM></P>
0
Comment
Question by:macuser777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Accepted Solution

by:
Barry62 earned 30 total points
ID: 9800129
Try CSS:



<FORM action=/cgi-bin/lance/search.cgi method=get>

<INPUT
      style="BORDER-RIGHT: #066c9f 1px solid; BORDER-TOP: #066c9f 1px solid; BORDER-LEFT: #066c9f 1px solid; BORDER-BOTTOM: #066c9f 1px solid; BACKGROUND-COLOR: #ecf1f5"
      onfocus=this.select() size=14 value="Find Find" name=keywords>

<INPUT
      type=image height=30 alt=Search width=22
      src="refferals_files/search.gif" value=Submit border=0 name=go2 style="vertical-align: middle;">
      </FORM></P>
0
 

Expert Comment

by:TigerBoy
ID: 9800157
How about putting it in a table?  You can set the vertical alignment.  

<FORM action=/cgi-bin/lance/search.cgi method=get>

<table border=1 cellspacing=0 cellpadding=0>
<tr>
<td valign=middle>
<INPUT
      style="BORDER-RIGHT: #066c9f 1px solid; BORDER-TOP: #066c9f 1px solid; BORDER-LEFT: #066c9f 1px solid; BORDER-BOTTOM: #066c9f 1px solid; BACKGROUND-COLOR: #ecf1f5"
      onfocus=this.select() size=14 value="Find Find" name=keywords>
</td><td valign=middle>
<INPUT
      type=image height=30 alt=Search width=22
      src="test.gif" value=Submit border=0 name=go2>
      </td></tr></table></FORM>

If you have white space around your image then it may be hard to center without seeing the image.
0
 
LVL 31

Assisted Solution

by:seanpowell
seanpowell earned 20 total points
ID: 9800884
The CSS code will work - you may find it off by a pixel or 2 depending on your browser. You can also use the absmiddle attribute:

<FORM action=/cgi-bin/lance/search.cgi method=get>
<INPUT style="BORDER-RIGHT: #066c9f 1px solid; BORDER-TOP: #066c9f 1px solid; BORDER-LEFT: #066c9f 1px solid; BORDER-BOTTOM: #066c9f 1px solid; BACKGROUND-COLOR: #ecf1f5"
      onfocus=this.select() size="14" value="Find Find" name="keywords">
<INPUT type=image height="30" alt=Search width="22" src="refferals_files/search.gif" value="Submit" border="0" name="go2" align="absmiddle">
</FORM>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:Zontar
ID: 9801284
Image inputs create usability and other problems. I suggest you use a standard type="submit" and apply CSS to the input to achieve the desired appearance:

<input type="submit" class="submitButton" value="Search">

.submitButton  { width:125px; height:55px; background-image:url('referrals_files/search.gif');  }
0
 
LVL 4

Author Comment

by:macuser777
ID: 9809929
Thanks all.

I used CSS as Barry62 suggested but had to use the absmiddle code to get it exact
so
30 Barry62
20 georgemarian.

0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9809997
Just glad it didn't give you a javascript error :-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
alert on input text 2 39
How do I show a login page over the login page? 5 57
Session on Html 8 54
CSS for Popup in ASP.NET 4 46
This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question