Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 使用样式化组件更改输入背景颜色_Css_Reactjs_Styled Components - Fatal编程技术网

Css 使用样式化组件更改输入背景颜色

Css 使用样式化组件更改输入背景颜色,css,reactjs,styled-components,Css,Reactjs,Styled Components,当用作样式化组件时,如何更改输入背景颜色 const MyInput = styled.input` background-color: "blue"; ` 这应该行得通 const MyInput = styled.input` background: blue; ` 你在混合符号。css中的值不是带引号的包装。样式化组件使用css标准符号,因此应该是blue,而不是“blue”。

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

const MyInput = styled.input`
background-color: "blue";
`
这应该行得通

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

你在混合符号。css中的值不是带引号的包装。样式化组件使用css标准符号,因此应该是
blue
,而不是
“blue”