Jump to content

Regarding <select>


anilkumar

Recommended Posts

Hi all, i had problem while using <select> tag in html page. i cant change the height of the select box during single selection. i had used the height attributes in select tag and in style tag also, but there was no effect. so, please tell me the attributes or the way to solve this problem.Thanks all,Regards,Anil.

Link to comment
Share on other sites

I'm not quite sure what you mean but this will change the height of the select and it's options. (note - works in Firefox not IE, why? cause it's IE :) )

<html><head><style>select, option{color:red;height:50px;}</style></head><body><form><select name="cars"><option value="volvo">Volvo<option value="saab">Saab<option value="fiat">Fiat<option value="audi">Audi</select></form></body></html>

Hope this helps :)

Link to comment
Share on other sites

i cant change the height of the select box during single selection.
If you're talking about changing the number of options that are displayed, the attribute is size, not height.<select size="5">
Link to comment
Share on other sites

But then the select changes into a box instead of a dropdown :)Height only works for a select element when it has been set to have multiple options visible, thus being a box instead of a dropdown. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...