【问题标题】:Spanning a range of colors to a text in HTML将一系列颜色扩展到 HTML 中的文本
【发布时间】:2022-02-09 04:42:55
【问题描述】:

我对 HTML 比较陌生,最近发现了一个网站(YT 视频),它在按钮上制作了一系列漂亮的颜色。网站链接:https://www.youtube.com/watch?v=OPaLnMw2i_0

我想知道这些使用的颜色范围是否可以用于 HTML 中的某些文本。谁能帮我解决这个问题? Range of colors used on the tab Button (This is done using React & Next.js)

提前致谢!

【问题讨论】:

    标签: html reactjs colors next.js


    【解决方案1】:

    您可以使用内联 CSS 及其线性渐变功能。

    阅读: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient()

    例子:

    <p style="
        background:linear-gradient(to left, blue, pink);
        font-family: sans-serif;
        color: white;
        font-weight: bold;
        width: 10em;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
        border-radius: 5%;
        margin: 10rem auto;
    ">Learn More</p>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-29
      • 2015-12-24
      • 1970-01-01
      • 2015-06-22
      • 2014-01-18
      • 1970-01-01
      相关资源
      最近更新 更多