Chrome和IE中的Ctrl F / Find功能修改布局 [英] Ctrl F/Find feature in Chrome and IE modifies layout

查看:114
本文介绍了Chrome和IE中的Ctrl F / Find功能修改布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在当前最简单的例子中( http://jsfiddle.net/twPHW/ ):

In the current minimal example (http://jsfiddle.net/twPHW/) :

<div style="overflow: hidden; height: 24px;">

<table>
<thead>
<tr>
<td style="background-color: rgb(109,173,157);">foo</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background-color: rgb(236,222,117);">bar</td>
</tr>
</tbody></table>

</div>

foo单元格是唯一可见的单元格。然后,如果我使用Ctrl-F(在浏览器中查找功能),并开始输入bar,div内的表就会上升(其顶部更改),以向用户显示匹配的元素。

The "foo" cell is the only one visible. Then if I do Ctrl-F (find feature in browser), and start typing "bar", the table inside the div will goes up (its top changes) to show to the user the matched element.

我知道这可能是一个功能,但对我来说它似乎是一个错误,因为它会修改网页的布局(清除搜索不会回退以前的顶层元素)。

I know it could be a feature, but to me it appears to be a bug because it modifies the layout of the web page (clearing the search does not rollback previous top element).

这个错误发生在Chrome和IE9中,而不是Firefox中。

This bug occurs in Chrome and IE9 but not in Firefox.

任何可以解决问题的解决方法?

Any workaround that could fix the issue ?

PS:这似乎是相关的浏览器ctrl + f在页面上查找显示静态页头后面的结果,但并不回答我的问题

PS: this seems to be related Browser ctrl+f find on the page shows result behind the static header but does not answer my question

推荐答案

溢出内容仍可搜索。如果您不希望显示,请使用 display:none

Overflow content is still searchable. If you don't want it shown, use display:none

这篇关于Chrome和IE中的Ctrl F / Find功能修改布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆