放大Chrome导致CSS定位问题 [英] Zooming on Chrome causes CSS positioning issues
问题描述
在Google Chrome浏览器中放大或缩小我的网页时,相互之间精确定位的项目会改变位置。这会导致很多问题:例如,在特定缩放级别,div会重叠其包含的div,只是足以隐藏边框。同样的,有时100%的标记也不会精确地与100%的分数对齐。
When I zoom in and out on my webpage in Google Chrome, items that are precisely positioned in relation to one another will change position. This causes many problems: For example, at specific zoom levels a div will overlap its containing div just enough to hide a border. Similarly, sometimes a 100% marker will not precisely line up with the 100% point.
有没有什么办法可以确保物品相对于每个物品的位置其他不会改变,当页面放大或缩小?
Is there any way I can ensure that the positioning of the items in relation to each other will not change when the page is zoomed in or out?
推荐答案
您可以使用em定位,将重新定位和大小基于字体大小。所以当人们喜欢control +或command +时,页面会自动调整大小。这是一个关于弹性布局的页面。希望这会有帮助。
You can use em positioning which will reposition and size based on the font size. So when people do like control + or command + then the page will auto resize. Here is a page about elastic layouts. Hope this helps.
http://v1.jontangerine.com/log/2007/09/the-incredible-em-and-elastic-layouts-with-css
这篇关于放大Chrome导致CSS定位问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!