Solved

Drop down menu

Posted on 2002-03-25
8
321 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
Industry Leaders: 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 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

Independent Software Vendors: 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!

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web page
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

679 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