【问题标题】:Change input background-color with styled-component使用样式组件更改输入背景颜色
【发布时间】:2019-03-05 08:39:03
【问题描述】:

当用作样式组件时,如何更改输入背景颜色?

const MyInput = styled.input`
background-color: "blue";
`

【问题讨论】:

  • 你在混合符号。 css 中的值不是带引号的包装器。并且 styled-components 使用 css 标准符号,所以应该是 blue 而不是 "blue"

标签: css reactjs styled-components


【解决方案1】:

这应该可以工作

const MyInput = styled.input`
background: blue;
`

【讨论】:

    猜你喜欢
    • 2021-03-07
    • 1970-01-01
    • 1970-01-01
    • 2014-07-17
    • 2010-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多