简体   繁体   English

chrome 移动 VS chrome 桌面:相同元素的不同位置

[英]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.

相关问题 桌面和移动设备上元素的位置不同 - Position of element different on desktop vs mobile Chrome桌面和实际移动设备上的不同Glyphicons - Different Glyphicons on Chrome desktop and real mobile device 元素在移动设备上的位置与桌面上不同 - Different position of element on mobile device than on desktop DIV以Chrome桌面为中心,但不在Chrome移动版中 - DIV centered in Chrome desktop, but not Chrome mobile iOS-HTML来源与检查桌面版Chrome中的元素时不同 - iOS - HTML source is different than when inspecting element in Chrome on desktop 固定在 chrome mobile 上的位置导致元素在向上/向下滚动时移动 - Position fixed on chrome mobile causing element to move on scroll up/down flex 框中的图像显示移动设备 chrome 和桌面 chrome+设备模式之间的不同尺寸 - Image in flex box showing different sizes between mobile device chrome and desktop chrome+device mode 屏幕上最底端的元素和向下滚动位置:ff与chrome - bottomest element on screen and scrolldown position: ff vs chrome 在桌面上使用 Chrome 移动视图和在移动设备上使用 chrome 的区别 - Difference in using chrome mobile view in desktop and using chrome in mobile Chrome中绝对定位的元素与其他浏览器的位置不同 - Absolutely positioned element in a different position in Chrome than other browsers
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM