3
正如你應該能夠看到這個fiddle以及下面的代碼一樣,我希望能夠將顯示在頂部的CSS生成的三角形分開第二格水平相等之間橙色和綠色使用的顏色。現在它只能在一個(橙色)中顯示。將一個CSS生成的三角形分成兩個水平不同的相同顏色
我不知道如何去做這件事。
HTML:
<div class="top">
<div class="triangle-down"></div>
</div>
<div class="bottom"></div>
CSS:
.top
{
background: -moz-linear-gradient(left, #FDC57B 0%, #FDC57B 50%, #85D782 50%, #85D782 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#FDC57B), color-stop(50%,#FDC57B), color-stop(50%,#85D782), color-stop(100%,#85D782)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #FDC57B 0%,#FDC57B 50%,#85D782 50%,#85D782 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #FDC57B 0%,#FDC57B 50%,#85D782 50%,#85D782 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #FDC57B 0%,#FDC57B 50%,#85D782 50%,#85D782 100%); /* IE10+ */
background: linear-gradient(to right, #FDC57B 0%,#FDC57B 50%,#85D782 50%,#85D782 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FDC57B', endColorstr='#85D782',GradientType=1); /* IE6-9 */
height: 100px;
position: relative;
}
.bottom
{
background: pink;
height: 100px;
}
.triangle-down{
width: 3%;
height: 0;
padding-left:3%;
padding-top: 2%;
overflow: hidden;
position: absolute;
left:0;right:0;
margin:auto;
top: 100px;
z-index:1;
}
.triangle-down:before {
content: '';
display: block;
width: 0;
height: 0;
margin-left:-50px;
margin-top:-33px;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 33px solid #FDC57B;
}
嗨,我有一點問題,得到它的工作我有它的問題的方式。也許你知道? – fakeguybrushthreepwood
好的,你遇到了什麼問題? – Marcatectura
我一直在堅持將上面發佈的示例與您的示例進行合併。我只是看不出2是如何結合的。 – fakeguybrushthreepwood