How to change the size of a drop-down menu

C

Cliff R.

Hi, I'm a bit stumped on this one, how can I change the size of a
drop-down menu? Either making the text smaller or the whole box
smaller? I've tried making the font size smaller using the option tag
in the stylesheet but it's not working. Sample code below... Thank
you!

<select name="menu">
<option value="index.htm" size=1 SELECTED>Choose an Item</option>
<option value="1.htm">item 1</option>
<option value="2.htm">item 2</option></select>
 
D

Disco Octopus

Cliff said:
Hi, I'm a bit stumped on this one, how can I change the size of a
drop-down menu? Either making the text smaller or the whole box
smaller? I've tried making the font size smaller using the option tag
in the stylesheet but it's not working. Sample code below... Thank
you!

<select name="menu">
<option value="index.htm" size=1 SELECTED>Choose an Item</option>
<option value="1.htm">item 1</option>
<option value="2.htm">item 2</option></select>

this does not work.....
<style type="text/css">
#name {
width: 250;}
</style>

but this does work....

<style type="text/css">
select {
width: 250;}
</style>
 
G

Guest

Cliff R. said:
Hi, I'm a bit stumped on this one, how can I change the size of a
drop-down menu? Either making the text smaller or the whole box
smaller? I've tried making the font size smaller using the option tag
in the stylesheet but it's not working. Sample code below... Thank
you!

<select name="menu">
<option value="index.htm" size=1 SELECTED>Choose an Item</option>
<option value="1.htm">item 1</option>
<option value="2.htm">item 2</option></select>

Style Sheets
 
L

Louis Somers

Hi, I'm a bit stumped on this one, how can I change the size of a
drop-down menu? Either making the text smaller or the whole box
smaller? I've tried making the font size smaller using the option tag
in the stylesheet but it's not working. Sample code below... Thank
you!

<html><head>
<title>FullScreen</title>
<style type="text/css">
select {height: 12; width: 100; max-height: 12}
</style>
</head>
<body>
<form method="post" action="hummm.bee">
<select name="menu">
<option value="index.htm" SELECTED>Choose an Item</option>
<option value="1.htm">item 1</option>
<option value="2.htm">item 2</option></select>
</form>
</body></html>

Works in Opra, only Height doesn't seem to work in IE, at lease Width does.
 
T

Toby A Inkster

Disco said:
this does not work.....
<style type="text/css">
#name {
width: 250;}
</style>

Of course it doesn't. "#name" selects the element with ID "name", when you
want to select the element with name "menu".

select[name="menu"] might be better, but that's not supported in IE.

Also, you missed the unit from your width. 250 hobnobs won't fit on most
screens.
 
C

Cliff R.

Sometime around Wed, 03 Dec 2003 23:51:40 GMT, Disco Octopus is reported to
have stated:

That depends on your definition of "work". 250 what? 250 bunyips?

http://www.w3.org/TR/REC-CSS2/syndata.html#length-units

Thank you -- that does work to change the size of the menu box. What
about reducing the size of the text within the box? I've tried select
{font-size:80%;} and option {font-size:80%;} without luck. (Using IE
6) Anyone? Thank you!
 
R

rf

Cliff R. said:
Thank you -- that does work to change the size of the menu box. What
about reducing the size of the text within the box? I've tried select
{font-size:80%;} and option {font-size:80%;} without luck. (Using IE
6) Anyone? Thank you!

Why would you want to make the text 80% of the size I have set as my
default? I would just up my default to put it back where I like it.

Cheers
Richard.
 
L

Louis Somers

toby is going to run out of hobnobs at this rate

Ok, correction:

<style type="text/css">
select {height: 12px; width: 100px; max-height: 12px}
</style>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top