【发布时间】:2018-06-30 04:52:39
【问题描述】:
我希望有人能够解释这个问题。环顾互联网,令人惊讶的是,我实际上找不到这个问题的详细解决方案或解释。
我包含的代码显示了使用弹性框的工作显示。大概这个问题只发生在弹性盒子上(如果我错了,请纠正我!)。但是,如果您在旧浏览器或某些手机/平板电脑上查看此代码,则显示非常错误。
我认为添加 webkit 规则可以解决问题,但它们似乎什么也没做。
- 如何解决此问题?
- 我是否可以在某个地方看到我需要为每个 flex(和其他?)规则添加到我的网站的 -webkit 或 -moz 规则列表?
非常感谢这里的任何帮助,谢谢!
Internet Explorer 9 上的显示问题:
iPad 4 上的 Safari 显示问题:
#wrap-a {
display: -webkit-flex;
display: flex;
-webkit-justify-content: space-evenly;
justify-content: space-evenly;
-webkit-flex-direction: row;
flex-direction: row;
align-items: center;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
}
.the-cta-top, .the-cta-bottom {
display: block;
font-weight: 300;
font-size: 16px;
color: #fff;
}
.the-cta-top a:link, .the-cta-top a:visited, .the-cta-middle a:link, .the-cta-middle a:visited, .the-cta-bottom a:link, .the-cta-bottom a:visited {
text-decoration: none;
color: #393939;
}
body {
height: 1000px;
width: 100%;
background: lightgreen
}
.the-cta {
box-sizing: border-box;
width: 150px;min-width: 150px;
height: 150px;
border: 1px solid #fff;
margin-top: 30px;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-justify-content: center;
justify-content: center;
align-items: center;
display: -webkit-inline-flex;
display: inline-flex;
border-radius: 50%;
}
<article id="wrap-a">
<nav onclick="location.href='#';" class="the-cta">
<span class="the-cta-top">some</span>
<span class="the-cta-middle"><a href="#">text</a></span>
<span class="the-cta-bottom">here</span>
</nav><!--
--><nav onclick="location.href='#';" class="the-cta">
<span class="the-cta-top">more</span>
<span class="the-cta-middle"><a href="#">text</a></span>
<span class="the-cta-bottom">here</span>
</nav>
</article>
【问题讨论】:
-
那么它在旧浏览器上的呈现有何不同? ...在图片中会有所帮助。
-
我没有图像,但圆圈显示在左侧,里面的所有文本都在顶部杂乱无章
-
如果您的受众使用 IE9,您的网站应该支持它,如果不支持,那么通常会将用户重定向到看起来不错的页面,或者告诉他们需要升级浏览器的页面。关于前缀,当新属性发布时,它们使用像
-webkit-这样的前缀,这是因为它们的定义以及它们的工作方式在标准化之前经常发生变化,因此需要前缀来实现旧浏览器版本的向后兼容性。跨度> -
我还使用适用于 IE9 的示例更新了我的答案。