Click here to Skip to main content
15,902,114 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all !!
I have a select with 3 options.
I want width of option fixed 100px not care data's length.

How can i do ???

I have tried code:

<div style="width:100px; overflow:hidden">
<select>option 1</select>
<select>option 2</select>
<select>option 3 option 3 option 3</select>

But is is only helpful in IE 7.
Posted
Updated 23-Dec-13 17:10pm
v5
Comments
BK 4 code 23-Dec-13 23:37pm    
Can you please represent your question in detail.
baotdinh 23-Dec-13 23:41pm    
Now, when i code with that code option will auto-width , but i want fix option's width.

1 solution

XML
<html>
<head>


<style>
select
{
width:100px;
    }
</style>
 

</head>
<body >
<div style="width:100px; overflow:hidden">
<select value='option1' text='option1'>option 1</select>
<select>option 2</select>
<select>option 3 option 3 option 3</select>
<select>option 3 option 3 option 3</select>
<select>option 3 option 3 option 3</select>
</div>

 
</body></html>



Use this style block
 
Share this answer
 
Comments
baotdinh 24-Dec-13 2:39am    
It doesnot work in chrome. It only works in IE 8.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900