200px
,这是一个渐变宽度,偏移了一半的200px
从中心开始。
.topbar {
height: 150px;
background:
/* the markers*/
linear-gradient(yellow 0 0) 25% /2px 100%,
linear-gradient(yellow 0 0) 50% /2px 100%,
linear-gradient(yellow 0 0) 75% /2px 100%,
/* the needed background*/
linear-gradient(-63deg, rgba(28,25,84,1) 50%,transparent 0) calc(50% - 100px) 0/200px 100%,
linear-gradient(rgba(28,25,84,1),rgba(28,25,84,1)) right/50% 100%,
linear-gradient(to bottom, red,blue);
background-repeat:no-repeat;
}
<div class="topbar"></div>
background-position
工作原理的详细信息:在线性渐变上使用百分比值和 background-position。
repeating-linear-gradient
吗? - Mr Lister