【问题标题】:Why isn't the color of the text changing?为什么文本的颜色没有改变?
【发布时间】:2021-04-01 09:43:08
【问题描述】:

我正在使用 react.js 制作一行三张图片,每张图片的顶部和底部都有几个字。出于某种原因,当我更改措辞的颜色时,它并没有改变。任何人都知道为什么以及如何解决它?谢谢

HTML 代码

<ImageContainer>
    <titleofexprience>
    stuff
    </titleofexprience>
    
    <img id="experienceImage" src={stufff} alt="nice" />

    <discriptionofexprience>
    </discriptionofexprience>
</ImageContainer>
export const titleofexprience  = styled.nav`
    position: absolute;
    bottom: 0px;
    color: #B0E0E6;
`
export const discriptionofexprience  = styled.nav`
position: absolute;
    bottom: 0px;
    color: #B0E0E6; //I try to change the color of the wording but it is not chaning it
`

【问题讨论】:

    标签: javascript html css reactjs colors


    【解决方案1】:

    为什么要为此使用&lt;nav&gt; 元素?您应该使用任何内联元素,例如 &lt;span&gt; 或其他东西。

    【讨论】:

    • 我遵循了一些教程,他们使用了导航
    • &lt;nav&gt; 是导航元素。如果它的导航,你应该在里面添加 &lt;a&gt; 元素。然后更改&lt;a&gt;颜色样式。
    猜你喜欢
    • 2011-11-21
    • 2016-08-12
    • 1970-01-01
    • 1970-01-01
    • 2018-05-30
    • 2016-11-13
    • 2016-05-12
    • 1970-01-01
    相关资源
    最近更新 更多