【发布时间】:2017-11-16 14:33:50
【问题描述】:
我看到一个只能在 iPhone Safari 上间歇性重现的错误(在任何其他移动或桌面浏览器上,甚至在 macbook safari 上都没有)。代码如下:
<div style="overflow: auto; height: calc(100% - 55px); background-color: cyan;">
<ul ...><li..></li> <!-- some ul containing li omitted for brevity-->
<label class="certainClassname" style="font-size: small; font-style: italic; width: 100%; text-align: center; background-color: yellow">
{{"msg" | translate}}
</label>
</div>
在我的其他样式表中:
.certainClassname {
cursor: pointer;
word-break: break-all;
}
msg = "PK 测试!"对于我的测试,虽然它通常有另一个价值。
问题是当 bug 如下重现时,此标签在边缘被裁剪:
此错误仅在 Safari iPhone 上出现,其他浏览器均未出现,并且似乎仅在第一次加载该页面时发生,而不是稍后发生。它可能与缩放有关,因为即使 iPhone 上最细微的捏合缩放也能修复它,并且标签文本(和黄色)会完全展开。
有人可以帮我在上面的 CSS 中诊断这个吗?我尝试修复在标签的 css 中使用每个,但没有一个有效:
display: inline;
display: inline-block;
display: block;
padding: 2px 10px 2px 10px;
margin-left: auto;
margin-right: auto;
z-index: 999;
clear: both;
(all these above tested but none fixes this issue seen intermittently and only on iPhone Safari).
【问题讨论】:
-
你能提供工作代码吗...?
-
以上是我允许分享的具体代码,但如果提出有关该标签或 div 标签的任何具体问题,我将尝试提供详细信息。谢谢。
标签: html css angularjs label mobile-safari