简体   繁体   English

iPad Safari 和 PC 浏览器中的图像渲染问题

[英]Image rendering issue in iPad Safari and PC browsers

Issue:问题:
PC browsers -- expected PC 浏览器 -- 预期
在此处输入图像描述

iPad rendering iPad 渲染图
在此处输入图像描述

Description:描述:
The above image is the expected result in all PC and Android browsers, but in iPad, it renders in a wrong result as second image.上图是所有 PC 和 Android 浏览器中的预期结果,但在 iPad 中,它呈现为第二张图像的错误结果。
Here is the codes below, I found if I take off width and height in.close-btn, the image size would be same as expected one except button size is still not correct.这是下面的代码,我发现如果我在.close-btn 中去掉宽度和高度,图像大小将与预期相同,只是按钮大小仍然不正确。
What if I replace button as div, it is in the correct result.如果我将按钮替换为 div,它的结果是正确的。
What does iPad do for the button element? iPad 对按钮元素有什么作用?
What if I want to keep using button for clearly semantics tag, how can I modify it for iPad?如果我想继续使用按钮来明确语义标签怎么办,我该如何为 iPad 修改它?

/** HTML */
    <button class="close-btn">
         <img src="close-btn.png" />
    </button>

/** CSS */
    .close-btn {
      position: absolute;
      right: 20px;
      width: 40px;
      height: 40px;
      border-radius: 20px;
      img{
        width: 23.5px;
        height: 23.5px;
      }
    }

try to use this to your .close-btn尝试将其用于您的.close-btn

-webkit-appearance: none;

becouse iPad changes the look of buttons and other controls to resemble standard controls.因为 iPad 将按钮和其他控件的外观更改为类似于标准控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM