【发布时间】:2019-06-02 18:54:52
【问题描述】:
我有一些文本在一个稍微不寻常的 flexbox/span 排列(the reason for which is explained here) 中,它没有在 Safari 中显示。在我尝试过的所有其他浏览器中它看起来都很好。
这似乎是一个常见的问题,但是most of the suggestions are to include different display:flex options,我已经申请了,但它仍然不起作用。
有人有什么想法吗?
HTML
<h1>
<span id="firstspan">this</span>
<span id="secondspan">phrase</span>
</h1>
CSS
h1 {
font-family: 'Fugaz One', serif;
font-weight:300;
position: absolute;
transform: rotate(-7.7deg);
color: transparent;
-webkit-background-clip: text;
background-clip: text;
background-image: -webkit-linear-gradient(8deg, #d58da3, #fa8567, #fa9551);
background-image: -moz-linear-gradient(8deg, #d58da3, #fa8567, #fa9551);
background-image: -ms-linear-gradient(8deg, #d58da3, #fa8567, #fa9551);
background-image: -o-linear-gradient(8deg, #d58da3, #fa8567, #fa9551);
background-image: linear-gradient(8deg, #d58da3, #fa8567, #fa9551);
background-position-y: 1vw;
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
font-size: 17.3vw;
left: -2vw;
top: calc(270px - 20vw); /*a smaller vw and it will move up as you shrink, a smaller px and it will shift up*/
}
#secondspan {
font-size: 13.7vw;
margin-left: -1vw;
margin-top: -10.5vw;
}
【问题讨论】:
-
官方 safari bug tracker 中有一个 bug。不幸的是,过去两年似乎没有人研究过它:bugs.webkit.org/show_bug.cgi?id=169125 另见:stackoverflow.com/questions/31289537/…