2017-04-26 43 views
-2

我已經嘗試了與此問題相關的Stack Overflow中的幾乎所有解決方案。我有下面的CSS代碼。如何在僞元素和較低的z-index之後使用css三角形?

.logo { 
background-image: url("../Images/Brookland-Splash- 
MOBILE_0000s_0000s_0001_BrooklandPress-CMYK-copy-2.png"); 
width:124px; 
height: 131px; 
float: left; 
margin-left: 290px; 
margin-top: 30px; 
margin-bottom: 93px; 
z-index: 10; 
} 
.logo::after { 
content: ''; 
border-left: 80px solid transparent; 
border-right: 80px solid transparent; 
border-top: 80px solid white; 
position: absolute; 
width: 0; 
height: 0; 
top: 120px; 
left: 275px; 
clear: both; 
} 

回答

0

.logo DIV

.logo { 
    background-image: url("../Images/Brookland-Splash- 
    MOBILE_0000s_0000s_0001_BrooklandPress-CMYK-copy-2.png"); 
    width:124px; 
    height: 131px; 
    float: left; 
    margin-left: 290px; 
    margin-top: 30px; 
    margin-bottom: 93px; 
    z-index: 10; 
    position: relative 
} 
.logo::after { 
    content: ''; 
    border-left: 80px solid transparent; 
    border-right: 80px solid transparent; 
    border-top: 80px solid white; 
    position: absolute; 
    width: 0; 
    height: 0; 
    top: 120px; 
    left: 275px; 
    clear: both; 
} 
+0

@超級用戶只需使用position: relative。這不適用於我 –

+1

@John。開發人員可以分享一個工作'小提琴',以便我們可以跟蹤你的問題 –