设置固定宽度选项选择html [英] Set fixed width option select html
本文介绍了设置固定宽度选项选择html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好!
我有3个选项。
我希望选项的宽度固定100px无关数据的长度。
我该怎么办???
我试过代码:
< div style =width:100px; overflow:hidden>
< select>选项1< / select>
< select>选项2< / select>
< select>选项3选项3选项3< ; / select>
但它仅在IE 7中有用。
解决方案
< html >
< head >
< style >
选择
{
宽度:100px;
}
< / style >
< / head >
< body >
< div style = width:100px; overflow:hidden >
< 选择 < span class =code-attribute> value =' option1' text =' option1' > 选项1 < / select >
< 选择 > 选项2 < / select >
< 选择 > 选项3选项3选项3 < / select >
< 选择 > 选项3选项3选项n 3 < / select >
< 选择 > 选项3选项3选项3 < / select > ;
< / div >
< / body > < / html < span class =code-keyword>>
使用此样式块
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.
解决方案
<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
这篇关于设置固定宽度选项选择html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文