Android浏览器延伸图像

前端之家收集整理的这篇文章主要介绍了Android浏览器延伸图像前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在说的这个网站是 is currently live.它对我来说很好.只有一个错误让我疯狂:

在标准的Android浏览器(在4.1.2测试,LG),标志被拉伸和调整大小是非常糟糕的.您可以在下面看到一个演示.

用于定位和尺寸标识的CSS非常简单,使用位置:绝对位置:固定元素:

标记

  1. <div class="fixed">
  2. <div id="logo">
  3. <a href="logo-link">
  4. <img src="logo.jpg" height="55" width="34">
  5. </a>
  6. </div>
  7. </div>

CSS:

  1. * {Box-sizing: border-Box} /* bootstrap system */
  2.  
  3. .fixed {
  4. position: absolute;
  5. top: 0;
  6. left: 0;
  7. right: auto;
  8. bottom: auto;
  9. height: 85px;
  10. }
  11.  
  12. .logo {
  13. width: 85px;
  14. position: absolute;
  15. top: 0;
  16. left: 0;
  17. right: auto;
  18. bottom: auto;
  19. }
  20.  
  21. img {
  22. margin: 20px 27px;
  23. max-width: 40px;
  24. height: auto;
  25. display: inline-block;
  26. }

解决方法

我的FF DE44检查员说父母< a>大小为0x24,< img>大小为240×164(为内联值).父对象没有z-index,而图像具有z-index:1500.

在我看来,Android浏览器没有宽度和高度的父值,它可以引用,而底部:auto和right:auto强制它做.

更进一步的是,看“现场”网站的代码比你在问题中声称的更多,因为你给出了小图像的价值,但是给出了大图的CSS(还有:auto,而小的人没有底部,左,右).

你最好再看一下你的代码,并修改你的问题中的代码,以反映“实时”版本的代码,否则我们将无法正确的帮助你.

猜你在找的Android相关文章