0
爲什麼不是#para1
呈現以上#para1:before
?
CODEPEN HERE
z-index不像預期的那樣呈現僞元素
.para {
color: #fafafa;
}
#para1 {
background: blue;
padding: 0 0 20px 0;
position: relative;
z-index: 2;
}
#para1:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 0px;
height: 0px;
border: 150px solid rgba(0, 0, 0, 0);
border-top: 0px solid rgba(0, 0, 0, 0);
border-right: 50px solid rgba(0, 0, 0, 0);
border-left: 500px solid rgba(0, 0, 0, 0);
border-bottom-color: red;
z-index: 1;
display: block;
}
#para1 {
font-size: 40px;
}
<div id="para1" class="para"><span class="hpro">HELLO <span class="bold">WORLD</span> </span> <span class="satisfy">pre launch contest festival</span>
</div>
你想要這個輸出http://jsfiddle.net/6yox39vx/ – 2014-12-27 14:12:14
或http://jsfiddle.net/6yox39vx/1/ – 2014-12-27 14:12:38
@VitorinoFernandes第二個。謝謝。 – Anubhav 2014-12-27 14:19:45