【发布时间】:2019-03-23 01:12:25
【问题描述】:
我以前从未使用过渐变,我正在尝试实现与此非常相似的东西
正如你所看到的,这个栏有相同的颜色,左右和中间的右边有一些更亮的渐变,我一直在尝试获得相同的外观,尝试首先关注渐变部分有了这个
export class LeaderboardBar extends React.Component<Props, State>
{
render()
{
return (
<div>
<div id="leaderboard-bar-left">
</div>
<div id="leaderboard-bar-right">
</div>
</div>
)
}
}
还有这个css
#leaderboard-bar-left {
width: 60%;
height: 40px;
background: linear-gradient(to top left, #1e2933 50%, #39424B 30%);
position: absolute;
top: 0;
left: 0;
}
#leaderboard-bar-right {
width: 40%;
height: 40px;
background-color: #1e2933;
position: absolute;
top: 0;
right: 0;
}
但这只会给我这种渐变
我似乎无法让过境变得更亮,越靠近对角渐变的中断,这是如何实现的?
【问题讨论】:
-
删除百分比语句“背景:线性渐变(左上角,#1e2933,#39424B);”而是。