[英]chrome mobile VS chrome desktop: different position of the same element
Trying to find an answer to why chrome on mobile phone shows the same code differently than desktop chrome (and firefox, edge, opera).试图找到为什么手机上的 chrome显示的代码与桌面 chrome (以及 firefox、edge、opera)不同的答案。 The <a>
text has a different position in <div>
container. <a>
文本在<div>
容器中的位置不同。
PS.附注。 Ive marked "BOOKS" on the screenshots to make it more visual.我在屏幕截图上标记了“BOOKS”以使其更加直观。 On desktop view <a>
is in the middle, on mobile - to the top.在桌面视图中<a>
在中间,在移动设备上 - 到顶部。
desktop:桌面:
mobile:移动的:
HTML: HTML:
<div class="topbar" id="tb-grad">
<a class="logomain" id="lm-shad">BOOKS & DVD</a>
<a></a>
<a></a>
</div>
CSS: CSS:
.topbar {
max-width: 600px;
font-size: 40px;margin: auto;
border-radius: 10px;}
.logomain {
font-family: 'Luckiest Guy', cursive;
font-size: 40px;
color: yellow;}
I went through the exact same problem and after many tests and missed hours found that fonts change in Chrome Mobile X Chrome Desktop.我遇到了完全相同的问题,经过多次测试并错过了几个小时,发现 Chrome Mobile X Chrome Desktop 中的字体发生了变化。
I know i may have arrived late, but if anyone experiences this problem try switching the font used for another.我知道我可能来晚了,但是如果有人遇到此问题,请尝试切换其他字体。 A good place to find fonts for this test may be the Google Fonts site.查找此测试字体的好地方可能是 Google 字体站点。
Test some sources for you to observe this behavior.测试一些来源以观察这种行为。
If you wish, you can control the highlight colors using the following:如果您愿意,可以使用以下方法控制高亮颜色:
::selection {
background:#BBD3FD;
}
::-moz-selection {
background:#BBD3FD;
}
This will ensure that the background color of the highlighted segment is the same across all devices.这将确保突出显示部分的背景颜色在所有设备上都相同。 #BBD3FD
is the pale blue that Google Docs uses for its highlight background. #BBD3FD
是 Google Docs 用于其突出显示背景的淡蓝色。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.