【发布时间】:2020-04-07 20:04:00
【问题描述】:
我得到了以下组件:
const FeedCardButton = props => {
return(
<button
type="button"
style={{backgroundColor: props.color,
filter: props.filter}}
className="feed-card-button">{props.title}</button>
);
}
现在我想为我的组件添加一个渐变作为背景,但是这样不行:
<FeedCardButton
title="heyhey"
color="-moz-linear-gradient(top, #34ac1a 0%, #84cd89 100%), -webkit-linear-gradient(top, #34ac1a 0%, #84cd89 100%),linear-gradient(to bottom, #34ac1a 0%,#84cd89 100%)"
filter="progid:DXImageTransform.Microsoft.gradient( startColorstr='#34ac1a', endColorstr='#84cd89',GradientType=0 );"></FeedCardButton>
我能做什么?
【问题讨论】:
标签: css reactjs components gradient linear-gradients