我已創建此模式,由藍色和紅色線組成。但是我無法找到一種方法將紅色和藍色的線(如果我是正確的話,就像是深紫色的東西)混合在一起(參見第三種情況)。有任何想法嗎?使用透明度不會有幫助,因爲我只希望它透過它。混合對角線性漸變
div{
width:50px; height:100px;
border: solid 2px black;
float:left;
margin:10px;
font-size:30px;
font-weight:bold;
}
.caro-pattern1 {
background-color:#2ECC40;
background-image: linear-gradient(-45deg, blue 5%, transparent 5%, transparent 45%, blue 45%, blue 55%, transparent 55%, transparent 95%, blue 95%);
background-size:50px 50px;
}
.caro-pattern2 {
background-color:#2ECC40;
background-image:
linear-gradient(45deg, red 5%, transparent 5%, transparent 45%, red 45%, red 55%, transparent 55%, transparent 95%, red 95%);
background-size:50px 50px;
}
.caro-pattern3 {
background-color:#2ECC40;
background-image:
linear-gradient(45deg, red 5%, transparent 5%, transparent 45%, red 45%, red 55%, transparent 55%, transparent 95%, red 95%),
linear-gradient(-45deg, blue 5%, transparent 5%, transparent 45%, blue 45%, blue 55%, transparent 55%, transparent 95%, blue 95%);
background-size:50px 50px;
}
<div class="caro-pattern1">1</div>
<div class="caro-pattern2">2</div>
<div class="caro-pattern3">3</div>
你可以做到這一點使用'RGBA()'顏色......像這樣:HTTPS: //jsfiddle.net/9sfnv62j/ –
@Minal Chauhan,這不是我想要的,我試圖將藍色與紅色混合。 –