Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to change the size of a drop-down menu

Reply
Thread Tools

How to change the size of a drop-down menu

 
 
Cliff R.
Guest
Posts: n/a
 
      12-03-2003
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>



 
Reply With Quote
 
 
 
 
Disco Octopus
Guest
Posts: n/a
 
      12-03-2003
Cliff R. wrote:
> 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>


 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      12-03-2003

"Cliff R." <> wrote in message
news:...
> 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




 
Reply With Quote
 
Louis Somers
Guest
Posts: n/a
 
      12-04-2003
Cliff R. <> wrote in
news::

> 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.

--
News Updater, No scripts, No Database
http://www.xmlssoftware.com/NUpdater
 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      12-04-2003
Disco Octopus wrote:

> Cliff R. wrote:
>
>> <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>


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.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      12-04-2003
Sometime around Wed, 03 Dec 2003 23:51:40 GMT, Disco Octopus is reported to
have stated:
>
> but this does work....
>
> <style type="text/css">
> select {
> width: 250;}
> </style>


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

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

--
Mark Parnell
http://www.clarkecomputers.com.au
 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      12-04-2003
in post <news:Xns9447B32FD9470546179nospamstudent@194.109. 133.29>
Louis Somers said:

> select {height: 12; width: 100; max-height: 12}


toby is going to run out of hobnobs at this rate

--
brucie
04/December/2003 10:34:52 am kilo
 
Reply With Quote
 
Cliff R.
Guest
Posts: n/a
 
      12-04-2003
On Thu, 4 Dec 2003 11:30:27 +1100, Mark Parnell
<> wrote:

>Sometime around Wed, 03 Dec 2003 23:51:40 GMT, Disco Octopus is reported to
>have stated:
>>
>> but this does work....
>>
>> <style type="text/css">
>> select {
>> width: 250;}
>> </style>

>
>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!



 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      12-04-2003

"Cliff R." <> wrote in message
news:...
> On Thu, 4 Dec 2003 11:30:27 +1100, Mark Parnell
> <> wrote:
>
> >Sometime around Wed, 03 Dec 2003 23:51:40 GMT, Disco Octopus is reported

to
> >have stated:
> >>
> >> but this does work....
> >>
> >> <style type="text/css">
> >> select {
> >> width: 250;}
> >> </style>

> >
> >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!


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.


 
Reply With Quote
 
Louis Somers
Guest
Posts: n/a
 
      12-04-2003
brucie <> wrote in news:bqlvht$24eomf$1@ID-
117621.news.uni-berlin.de:

> in post <news:Xns9447B32FD9470546179nospamstudent@194.109. 133.29>
> Louis Somers said:
>
>> select {height: 12; width: 100; max-height: 12}

>
> 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>

--
News Updater, No scripts, No Database
http://www.xmlssoftware.com/NUpdater
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Preferred Size, Minimum Size, Size Jason Cavett Java 5 05-25-2008 08:32 AM
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
Firefox - Prevent TextField size change when user changes font size? Wongod HTML 2 10-04-2006 12:26 PM
A Paradise DNS address change? What change? There was no change. Tony Neville NZ Computing 7 09-22-2006 01:02 PM
Dumb question about using a <SELECT> menu to change the state of<SELECT> menu... Bonge Boo! Javascript 5 04-25-2005 10:49 PM



Advertisments