我有下面的代碼創建在頁面的頂部和底部的三角形div
:屏蔽掉三角格
#arrowdown, #arrowup {
display: block;
position: fixed;
left: 0; right: 0;
width: 0; height: 0;
margin: 0 auto;
border-left: 55px solid transparent;
border-right: 55px solid transparent;
z-index: 20;
}
#arrowdown {
bottom: 0;
border-bottom: 55px solid rgba(250,250,250,0.75);
}
#arrowup {
top: 0;
border-top: 55px solid rgba(250,250,250,0.75);
}
#arrowdown .icn, #arrowup .icn {
display: block;
position: absolute;
left: -18px;
color: #000;
text-align: center;
padding: 10px;
z-index: 25;
}
#arrowdown .icn {bottom: -52px;}
#arrowup .icn {top: -52px;}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.1/css/font-awesome.css" rel="stylesheet"/>
<button id="arrowup">
<i class="icn fa fa-chevron-up fa-2x"></i>
</button>
<button id="arrowdown">
<i class="icn fa fa-chevron-down fa-2x"></i>
</button>
這將創建與icn
S的內部的三角形。我想要三角形透明(現在是白色),外面有2pt的藍色邊框。我發現的例子把一個元素放在另一個元素的頂部,這將不起作用,因爲它會通過頂部透明度看到。
混淆爲如何解決這個問題? – user3550879