Option标签的文本省略号属性在IE中不起作用

时间:2016-07-26 06:48:03

标签: javascript jquery html css

文本溢出:省略号属性适用于DIV标记,但不适用于IE中的OPTION标记。像DIV和SPAN这样的标签(如建议here)工作正常,但OPTION标签效果不佳。

<html>
<head>
<style>
    .div-style
    {
        text-overflow: ellipsis;
        overflow: hidden;
        word-wrap: normal;
        white-space: nowrap;
        width: 100px;
    }

    .option-style
    {
        text-overflow: ellipsis;
        overflow: hidden;
        word-wrap: normal;
        white-space: nowrap;
        width: 100px;
    }
</style>
</head>
<body>
    <div class="div-style">
        This is a sample div to check text-oveflow property in IE.
    </div>
    <div>
        <select size="6">
            <option class="option-style">This is a very long option 1</option>
            <option class="option-style">Option 2</option>
            <option class="option-style">Option 3</option>
        </select>
    </div>
</body>
</html>

同样适用于Firefox。我错过了什么吗?

0 个答案:

没有答案