我能设置渐变色用户名吗?

我已经研究过了,并且找到了这段代码;

// Gruplara ait renkler
.names {
span.Premium a {
    background: linear-gradient(to right,#BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  span.moderator a::after {
    content:"★";
    margin-left: 2px;
  }
}

并将其粘贴到了 CSS 中,但它不起作用。

你好,

在这里,Premium 似乎是用户的首要群组,而另一部分仅适用于版主。我认为这就是它对你不起作用的原因。

.names {
  // This part is works only for users who's primary group is Premium
  span.Premium a {
    background: linear-gradient(to right,#BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  // This part is works only for moderators
  span.moderator a::after {
    content:"★";
    margin-left: 2px;
  }
}

如果你希望它对所有人可见,那么你不应该使用任何群组。删除 Premium 一词即可解决此问题。

.names {
  // This part is works for everyone
  span a {
    background: linear-gradient(to right,#BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  // This part is works only for moderators
  span.moderator a::after {
    content:"★";
    margin-left: 2px;
  }
}

Screenshot 2022-08-14 at 20.51.41

我现在也是版主了,所以 :star: 也出现了。

Screenshot 2022-08-14 at 20.52.05


如果你想将其限制为特定群组,那么你可以遵循你分享的默认代码,但将 Premium 一词更改为你的群组名称,并且不要忘记将群组设置为成员的首要群组。 :slightly_smiling_face:

就像这样 :arrow_down_small:

.names {
  // This part is works only for users who's primary group
  span.group_name a {
    background: linear-gradient(to right,#BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  // This part is works only for moderators
  span.moderator a::after {
    content:"★";
    margin-left: 2px;
  }
}
4 个赞

谢谢,它正在工作,但它没有显示在个人资料中,我该如何设置?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.