相关疑难解决方法(0)

Chrome搜索功能(ctrl + f)会找到隐藏的文字(但它不可见!)

看看这个小提琴.

输入Ctrl+ F并搜索"获取"...

对我来说,Chrome会从此文本中找到不可见的文字: A long option that gets cut off

它在Linux/Ubuntu 12.04 Chrome版本31.0.1650.63上重现

HTML

<!--works for a div-->
<div>
    A long option that gets cut off
</div>

<!--but not for a select-->
<select>
    <option>One - A long option that gets cut off</option>
    <option>Two - A long option that gets cut off</option>
</select>
Run Code Online (Sandbox Code Playgroud)

CSS

select {
    width:100px; 
    overflow:hidden; 
    white-space:nowrap; 
    text-overflow:ellipsis;
}

div {
    border-style:solid; 
    width:100px; 
    overflow:hidden; 
    white-space:nowrap; 
    text-overflow:ellipsis;
}
Run Code Online (Sandbox Code Playgroud)

如何在页面上显示文本,而不是浏览器突出显示的空白块空白?

html css google-chrome ellipsis styling

14
推荐指数
1
解决办法
3725
查看次数

标签 统计

css ×1

ellipsis ×1

google-chrome ×1

html ×1

styling ×1