html dropdown goes up rather than down

My html dropdown list is near the bottom of the page and as a result, the list goes up rather than down. I was wondering if it is possible to make the dropdown go down? Lets say by when selecting the dropdown only 10 items appear and with a scroll bar. I don't want to set size=10 because then I find that the dropdown then initially displays 10 items when you come into the page, rather than just the default "select" that I want. I basically only want it to show 10 items when you click the down arrow for the dropdown. At the moment there are about 70 items on the dropdown. If it only showed 10 items and with a scrollbar for the others then it would fit the browser window fine with the dropdown going down.

Is this possible?

Thanks
RupertAAsked:
Who is Participating?
 
Gurvinder Pal SinghCommented:
if i have understood the question, you are looking for scrollbar in the drop-down.
Please check this link
http://www.dynamicdrive.com/forums/archive/index.php/t-13955.html

Just put your select tag inside this div tag
<div style="height:200px; overflow-y:scroll">...</div>

0
 
scrathcyboyCommented:
"My html dropdown list is near the bottom of the page"

The browsers do this automatically, based on a windows convention, that if a link is near the bottom of a page, opening a "dropdown" menu will NOT scroll the page (too complicated on a web page) -- rather, the browser, like MS OSs, will place the bottom of the dropdown list at the cursor, and top of the list above it, to avoid scrolling the page.  

The solution to this is to put more content BELOW where the dropdown list is -- at least enough to take up the same vertical height as the dropdown list.  When the user has scrolled the page down to see that other content below the list, everything will work correctly, as you want it.  The other way is to place the list at a point higher in the page.  The key is to have page content well below the dropdown list.
0
 
RupertAAuthor Commented:
Thank you both and apologies in slowness of getting back. gurvinder's does work. However I take scrathcyboy's point about better layout. I think I will go for the better layout option.

I'm going to split points 50/50

thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.