anilkumar Posted June 2, 2006 Share Posted June 2, 2006 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 More sharing options...
scott100 Posted June 2, 2006 Share Posted June 2, 2006 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 More sharing options...
aspnetguy Posted June 2, 2006 Share Posted June 2, 2006 By changing the font-size of the select it will change the height. Link to comment Share on other sites More sharing options...
scott100 Posted June 2, 2006 Share Posted June 2, 2006 By changing the font-size of the select it will change the height.<{POST_SNAPBACK}> Yeah that's true and does work in IE, but obviously you then have a massive font... damn IE Link to comment Share on other sites More sharing options...
reportingsjr Posted June 2, 2006 Share Posted June 2, 2006 what about changing the line spacing? that might work.. but there would be big spaces. (unless its depriacated) Link to comment Share on other sites More sharing options...
justsomeguy Posted June 4, 2006 Share Posted June 4, 2006 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 More sharing options...
Jack McKalling Posted June 4, 2006 Share Posted June 4, 2006 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 More sharing options...
justsomeguy Posted June 5, 2006 Share Posted June 5, 2006 I know what size and height do, I was asking if he meant size when he said height. He does call it a "select box". Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 5, 2006 Share Posted June 5, 2006 So,anilkumar, do you mean a box with several options visible, or a dropdown with only one option visible? :)On that it depends how the height property will act. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now