Solved

Drop down menu

Posted on 2002-03-25
8
318 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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6895103
Try:

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

Cd&
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

948 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now