【发布时间】:2020-08-25 14:52:50
【问题描述】:
我正在尝试在笔划的同时添加条纹文本阴影,就像下图一样
这是我到目前为止所得到的,它很接近但不正确。我无法让它完全按照所附图片工作
.headingStyle {
background-image: -webkit-repeating-linear-gradient(60deg, #ccc, #ccc 1px, #fff 2px, #fff 3px);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
position:relative;
text-transform: uppercase;
font-weight: 700;
}
.headingStyle:after {
background: none;
content: attr(data-text);
left: -.1em;
position: absolute;
text-shadow: 1px 1px 0px #000;
top: -.05em;
text-transform: uppercase;
}
/**/
h1 {
font-size: 5em;
font-family: sans-serif;
margin-left: 100px;}
<h1 class="headingStyle" data-text="UNION">UNION</h1>
在这里找到一个工作示例:https://codepen.io/patie/pen/KKzWmNV
【问题讨论】: