|
-
Feb 2nd, 2001, 10:04 AM
#1
Thread Starter
Hyperactive Member
Does anyone know if its possible to set the width of a dropdown menu on an ASP page.
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Feb 2nd, 2001, 10:29 AM
#2
Dont think there is. Its always as wide as your longest item.
-
Feb 2nd, 2001, 11:42 AM
#3
New Member
There is a way - I found it by accident.
I tried everything, and I couldn't find a way to set the width of a drop down box; I tried setting the width of the form, the width of the <select> tag, the width of the <option> tags. Nothing. Then I just-for-the-hell-of-it thought try CSS. So I created a one-line CSS file;
select {width : 450 }
and saved it as build.css (the name was relevant to the project I was doing)
then added the following line in the <HEAD> section of the file with the drop down boxes that needed formatting;
<LINK REL="StyleSheet" TYPE="text/css" REF="build.css">
And voila, it worked ! Now, I don't know if all browsers will format this properly, especially Netscape, but I know it works in IE 5+.
If you want to see a working example and download some very basic code done in about a minute goto
http://www.nickclarkson.co.uk/dropdown.html
In the example I created a subclass called alternative to demonstrate how easy it is to change the width. If you need any more information on CSS try http://www.w3schools.com/css - it's a really good site.
(Oh and the site is new, so there's not a lot there 
Nick Clarkson
-
Feb 2nd, 2001, 04:59 PM
#4
PowerPoster
I got it
Hi now i got the answer!
use the style sheet in the select tag like this:
<select style="width: 344px">
</select>
The width is 344 pixels. You can make it as wider as you can.
This one should work!!!!!!
-
Feb 2nd, 2001, 07:28 PM
#5
New Member
Abdul,
You mean a bit like I said in my post about 12 hours ago ?
-
Feb 2nd, 2001, 07:44 PM
#6
PowerPoster
Sorry!
Sorry guy!
Actually I did not look at your code. I already knew that becasue I used Ms Script program.
-
Feb 5th, 2001, 04:25 AM
#7
Thread Starter
Hyperactive Member
Thanks everyone that sorted it
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|