gpt4 book ai didi

html - iPhone 3GS 上的标题显示不正确

转载 作者:行者123 更新时间:2023-11-28 04:38:02 24 4
gpt4 key购买 nike

我将这段代码用于我的网站标题:

<!DOCYTYPE>
<html>
<head>
<style>
#image_header {
border-radius:20px;
user-drag:none;
user-select:none;
-moz-user-select:none;
-webkit-user-drag:none;
-webkit-user-select:none;
-ms-user-select:none;
height:100%;
position:absolute;
top:0;
left:50%;
transform:translateX(-50%);
}
#header_image {
width:100%;
height:150px;
overflow:hidden;
position:relative;
border-radius:30px;
}
</style>
</head>
<body>
<div id="header_image"><a href="/"><img id="image_header" src="http://static.adzerk.net/Advertisers/78e105390cf2426896c5fc38ae85a4f6.png"></a></div>
</body>
</html>

当浏览器窗口小于图像时,该代码会在左侧和右侧剪切标题图像。

我在多个设备和系统上对其进行了测试,它运行良好。

只有运行最新版本 6.1.6 的 iPhone 3GS 显示效果不佳。这是它的样子:

Wrong display on iPhone 3GS

有人知道为什么会这样吗?我该如何解决?

最佳答案

问题可能在于使用 CSS 的转换。你可以在这里查看: http://caniuse.com/#feat=transforms2d

因为它是 3Gs iPhone,我想你确实检查了浏览器的支持。

请尝试添加前缀 -webkit-transform: translateX(-50%) 否则请更改使用 position for transformationbackground-position: center;

关于html - iPhone 3GS 上的标题显示不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41375160/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com