边框尺寸变化,如果我放大页面 [英] border size change if i zoom the page

查看:101
本文介绍了边框尺寸变化,如果我放大页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是无法理解......



我已经设定:

  border:2px solid#646464; 

2px但并非总是如此,实际上根据页面缩放,范围从1.4px和2px .. 。
然而我没有修改边界大小的js代码...



这怎么可能????



查看jsfiddle并更改缩放比例



是相同的



我认为:当您以相同的比例缩放页面大小更改时。如果一个div 100 px变成50px,那么200px到100px的范围就会变成。这里边界的大小并不尊重这个比例!

解决方案

Chrome在子像素渲染上更好,所以问题通常不是观察到,但许多浏览器将事物整数像素,这将导致类似的问题,因为这一点。



当你的边框是2px,你缩放0.7时,你得到1.4px,并可能通过一些浏览器四舍五入到1px(考虑到元素的两侧吃了0.8px)。当周围有很多圆形堆积物(例如填充物,边距,高度等)时,您可能会丢失2px至4px的总和,这可能相当重要。


guys I just can not understand ...

I have set:

border: 2px solid #646464;

2px but not always, in fact according to the page zoom, ranges from 1.4px and 2px ... yet I have no js code that modifies the size of the border ...

How is it possible????

see jsfiddle and change zoom

http://jsfiddle.net/00zv3zLy/

the height of box "log in" and box where is search bar it should be the same...but when change zoom it is not the same (because the border size of searchbar change)...

ARE NOT THE SAME

ARE THE SAME

I THINK THAT: when you zoom a page size change with the same proportion. If a div 100 px becomes 50px, then a span of 200px to 100px become. HERE the size of the border does not respect this proportion!

解决方案

Chrome is better at sub pixel rendering so the issue is usually not observed, but many browsers will round things to integer number of pixels, which will cause similar problems as this one.

When your border is 2px and you scale by 0.7, you get 1.4px and might be rounded to 1px by some browser (eating up 0.8px considering both sides of the element). When there's lots of rounding piling around (such as paddings, margins, height etc.), you may loose a sum of 2px to 4px which could be quite significant.

这篇关于边框尺寸变化,如果我放大页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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