0
我試圖爲線性漸變添加到<text>
標籤,通過<svg>
,它適用於大多數的瀏覽器,除了在Safari瀏覽器V8 +,其中文本的一部分似乎剪輯。SVG的文本線性漸變削減文本[Safari瀏覽器]
我想它要麼不對勁:
- 字體家族:普萊費爾,途中其渲染(試圖等待負荷和後注入的SVG,但最終結果相同
- 失蹤
viewbox
ATTR:嘗試添加它,似乎並沒有太大變化,或不涉及這個問題(我可能是錯的) - 不正確的代碼 - 似乎在其他瀏覽器檢點
這裏有一個代碼片段和一個codepen。
任何幫助,非常感謝。
@import url(https://fonts.googleapis.com/css?family=Playfair+Display:700italic);
.not-found{
font-size: 270px;
font-family: 'Playfair Display';
}
<svg width="100%" height="190px" class="not-found">
<defs>
<linearGradient id="text" x1="0" y1="0" x2="0" y2="100%">
<stop stop-color="green" offset="0"/>
<stop stop-color="red" offset="100%"/>
</linearGradient>
</defs>
<text text-anchor="middle" x="50%" y="50%" dy="50px" fill="url(#text)">
404
</text>
</svg>