【问题标题】:I need advice about gradient italic text我需要关于渐变斜体文本的建议
【发布时间】:2019-06-28 21:15:16
【问题描述】:

我发现了一个在文本上应用渐变的技巧。它可以,但是当我应用斜体字体样式时,字体在极端处有点剪裁

h2 {
  font-family: 'FMono';
  text-transform: uppercase;
  font-style: normal;
  font-weight: 900;
  font-size: 5rem;
  line-height: 0rem;
  color: #000;
}

h2 > span {
  font-family: 'FMono';
  text-transform: uppercase;
  font-style: italic;
  font-weight: 900;
  font-size: 5rem;
  line-height: 15rem;
  background: linear-gradient(152.36deg, #FF1053 26.66%, #AF19E4 89.65%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
<h2>sport your <br> <span>creativity</span> </h2>

【问题讨论】:

    标签: html css gradient linear-gradients


    【解决方案1】:

    只需将padding-left: 10px 添加到跨度...

    h2 {
      font-family: 'FMono';
      text-transform: uppercase;
      font-style: normal;
      font-weight: 900;
      font-size: 5rem;
      line-height: 0rem;
      color: #000;
    }
    
    h2 > span {
      font-family: 'FMono';
      text-transform: uppercase;
      font-style: italic;
      font-weight: 900;
      font-size: 5rem;
      line-height: 15rem;
      background: linear-gradient(152.36deg, #FF1053 26.66%, #AF19E4 89.65%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      padding-right: 10px;
    }
    <h2>sport your <br> <span>creativity</span> </h2>

    【讨论】:

      猜你喜欢
      • 2015-03-18
      • 1970-01-01
      • 2019-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-17
      • 1970-01-01
      相关资源
      最近更新 更多