Solved

Drop down menu

Posted on 2002-03-25
8
320 Views
Last Modified: 2010-04-09
I have a simple drop down menu and an image for the go button.  For some reasons, the row ends up higher than what it should be and the button is higher than the menu itself.  I even tried setting the height of the <tr> but didn't work.  The form works fine but the alignment doesn't. Here is a sample code for it..

<form name="jump">
<script>
function jumpMenu(){location=document.jump.menu.options[document.jump.menu.selectedIndex].value;
}
</script>
<select name="menu">
<option value="http://www.toronto.edu/" selected>UofT</option>
<option value="http://www.ryerson.edu/">URyerson</option>
<option value="http://www.york.edu">YorkU</option>
</select>
<a href="Javascript:jumpMenu()"><IMG SRC="go.gif" border=0 width="22" height="22"></a>
</form>
0
Comment
Question by:qudoos
8 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 100 total points
ID: 6895017
set the align in the image tag:

<a href="#" onClick="jumpMenu(); return false;"><IMG SRC="go.gif" border="0" width="22" height="22" align="top"></a>


... or you might try align="bottom" , I don't remember which one
0
 
LVL 18

Expert Comment

by:bruno
ID: 6895021
you most likely need to set alignment on the image...

check here for the proper values for that attribute, and try a few until it works.

http://www.blooberry.com/indexdot/html/tagpages/i/image.htm#attrib



BRUNO
0
 
LVL 18

Expert Comment

by:bruno
ID: 6895025
sorry, knight, your comment wasn't there when i started posting.


gudoos, make sure you check what the alignment looks like in any browser you need it to work in.  while one value might look ok in one browser, might not look good in another.  make sure to try them all...sometimes things like "baseline" or "textop" or "absmiddle" work well as well.


BRUNO
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6895103
Try:

<IMG SRC="go.gif" style="float:right" border=0 width="22" height="22">

Cd&
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6895664
or you can position the image as and where you want,

some ppl may not want to do this, but it still is a solution


<IMG SRC="go.gif" style="position:absolute;top:10px;left:10px" border=0 width="22" height="22">
for more css http://www.w3.org/

lexxwern
0
 
LVL 3

Expert Comment

by:winningl
ID: 6896817

place a <table> there to format the form display.


*****************************

<form name="jump">
<table>
<script>
function jumpMenu(){location=document.jump.menu.options[document.jump.menu.selectedIndex].value;
}
</script>
<tr><td>
<select name="menu">
<option value="http://www.toronto.edu/" selected>UofT</option>
<option value="http://www.ryerson.edu/">URyerson</option>
<option value="http://www.york.edu">YorkU</option>
</select></td>

<td>
<a href="Javascript:jumpMenu()"><IMG SRC="go.gif" border=0 width="22" height="22"></a></td>

</tr></table>
</form>

winningl
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 6897029
You may also want to try resizing your image to match the line height...

try 10 or 12 pixels high for your image height

JimS
0
 
LVL 1

Author Comment

by:qudoos
ID: 6897154
Works perfectly!! Thank you.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

860 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