Chrome:网页元素的自动移动 [英] Chrome: Automatic shift of web elements
问题描述
我在做一个网络项目.在过去的两周里,我正在参加学期考试,所以我要休息一下.现在,既然他们都结束了,我又恢复了工作;但我发现我的一些网络元素(如按钮、跨度)在 Chrome(而不是 IE 和 Mozilla)上移动了一些像素.这背后的原因可能是什么?我该如何克服这个问题?
I'm working on a web project. In the last two weeks I was having my semester examinations so I'd to take a break from it. Now, since they are over, I've resumed my work; but I find that some of my web elements (like button,span) have shifted by some pixels on Chrome (not on IE and Mozilla). What could be the reason behind this? How do I overcome this problem?
原始代码:http://jsfiddle.net/p22L15vs/15/embedded/result/
Chrome 的左边距(按钮)原本是:
The left margin (for button) for chrome was originally:
-webkit-margin-start:620px;
现在相同的代码使按钮进入一个新行.
Now the same code causes the button to enter a new line.
span 的另一个例子:
Another example of span:
原始代码:http://jsfiddle.net/vbpasx1j/
小提琴中显示的文本被放置在一个跨度标签中.两周前,它只需要两条线.现在它需要三行.
The text shown in the fiddle was placed in a span tag. Two weeks ago it required only two lines. Now it requires three lines.
推荐答案
这是由于 Chrome 37 中的标题更改,引入了对 Windows 的 DirectWrite 支持.查看此链接了解更多详情:
This is to due the headline change in Chrome 37 ,the introduction of DirectWrite support for Windows. Check this link for further details:
http://www.omgchrome.com/google-chrome-37-arrives-improved-font-rendering-windows/
这个功能给不同的开发者带来了类似的问题.
This feature has caused a similar issue for various developers.
为了恢复到以前的字体,解决方案是在浏览器中禁用此新功能.您需要按照以下步骤操作:
In order to restore to your previous font, the solution is to disable this new feature in your browser. You need to follow the following steps:
1> 在地址栏中输入 chrome://flags/.
1> Enter chrome://flags/ in your address bar.
2> 在 Disable DirectWrite Windows 部分点击 Enable(实际上是禁用它).
2> In the Disable DirectWrite Windows section click on Enable (actually disables it).
3> 点击底部的立即重新启动.
3> Click on Relaunch Now at the bottom.
4> 重新启动浏览器.
4> Restart your browser.
您的原始页面设计保持不变.:)
Your original page design remains unchanged. :)
这篇关于Chrome:网页元素的自动移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!