Ctrl F / Search function in Chrome and IE changes layout

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>

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

I know this may be a function, but to me it seems like a mistake because it changes the layout of the web page (clearing the search does not undo the previous top element).

This error occurs in Chrome and IE9, but not in Firefox.

Any workaround that might solve the problem?

PS: ctrl + f ,

+2
1

. , , display:none

0

Source: https://habr.com/ru/post/1607400/


All Articles