我想使用纯 CSS 实现以下形状,没有图像。
我已经到了以下几点。
这是HTML结构:
<div class="sixteen columns">
<div id="applicationStatus">
<ul>
<li class="applicationStatus">Application Received</li>
<li class="applicationStatusGood">Language Exam</li>
<li class="applicationStatusNoGood">Oral Exam</li>
<li class="applicationStatus">Grant</li>
</ul>
</div>
</div>
这是CSS:
#applicationStatus {
position: relative;
width: auto;
height: 140px;
left: 40px; }
ul.applicationStatus {
list-style: none; }
li.applicationStatus, li.applicationStatusGood, li.applicationStatusNoGood {
height: 140px;
background-color: #767676;
display: inline-block;
/* Dirty IE Hack */
zoom: 1;
*display: inline;
margin-right: 30px;
margin-left: 30px;
padding: 10px;
color: white;
font-size: 18px;
text-align: center;
line-height: 150px;
/* vertical-align: middle; */ }
li.applicationStatus:after, li.applicationStatusGood:after, li.applicationStatusNoGood:after {
content: "";
position: absolute;
width: 0;
height: 0;
border-top: 80px solid transparent;
border-left: 30px solid #767676;
border-bottom: 80px solid transparent;
margin: -10px 90px 0 10px; }
li.applicationStatus:before, li.applicationStatusGood:before, li.applicationStatusNoGood:before {
content: "";
position: absolute;
width: 0;
height: 0;
left: 0px;
border-top: 80px solid transparent;
border-left: 30px solid white;
border-bottom: 80px solid transparent;
margin: -10px 0px 0 0px; }
li.applicationStatus:first-child, li.applicationStatusGood:first-child, li.applicationStatusNoGood:first-child {
margin-left: 0px;
text-indent: 30px; }
li.applicationStatus:last-child, li.applicationStatusGood:last-child, li.applicationStatusNoGood:last-child {
border-top: 0px solid transparent;
border-left: 0px solid transparent;
border-bottom: 0px solid transparent; }
li.applicationStatusGood {
background-color: #77a942; }
li.applicationStatusGood:after {
border-left: 30px solid #77a942; }
li.applicationStatusNoGood {
background-color: #c42c00; }
li.applicationStatusNoGood:after {
border-left: 30px solid #c42c00; }
为什么:before
选择器不适用于所有形状或全部如何实现我想要的?