-4

嗨,

:after 元素的位置有问题。我想落后于 .step-s3 ,不知道为什么不工作。已经尝试使用 position: absolute 和 nothing。任何的想法?

这是示例

4

1 回答 1

0

这应该是你要找的?

.steps-s3{
    width: 150px;
    margin-right: 30px;
    
    font-family: "Play";
    font-weight: bold;
    font-size: 12px;
     color: #787878;
     text-transform: uppercase;
     
     -webkit-border-top-left-radius: 3px;
    -webkit-border-bottom-left-radius: 3px;
    -moz-border-radius-topleft: 3px;
    -moz-border-radius-bottomleft: 3px;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px; 
     
 
    height: 30px;
    line-height: 30px;
    padding: 0 9px 0 25px;
    white-space: nowrap;
    
    
    border-top: 1px solid #d1d1d1;
    border-bottom: 1px solid #d1d1d1;
    border-left: 1px solid #d1d1d1;
    
   background: rgb(255,255,255); /* Old browsers */
    background: -moz-linear-gradient(top,  rgba(255,255,255,1) 0%, rgba(246,246,246,1) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(246,246,246,1))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(246,246,246,1) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(246,246,246,1) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(246,246,246,1) 100%); /* IE10+ */
    background: linear-gradient(to bottom,  rgba(255,255,255,1) 0%,rgba(246,246,246,1) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
}

.steps-s3:after{
    position: relative; 
    display: block;
    z-index: -100;
    left: 144px;
    bottom: 15px;
    content: ' ';

    width: 21px;
    height: 20px;
    background: #ccc;
    -webkit-transform: rotate(-45deg);
    -webkit-transform-origin: 0 0;
    -moz-transform: rotate(-45deg);
    -moz-transform-origin: 0 0;
    -o-transform: rotate(-45deg);
    -o-transform-origin: 0 0;
    -ms-transform: rotate(-45deg);
    -ms-transform-origin: 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 0;
    
    border-left: 1px solid #d1d1d1;
    border-top: 1px solid #d1d1d1;
    border-right: 1px solid #d1d1d1;
    border-bottom: 1px solid #d1d1d1;
    
    background: rgb(255,255,255); /* Old browsers */
    background: -moz-linear-gradient(top,  rgba(255,255,255,1) 0%, rgba(246,246,246,1) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(246,246,246,1))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(246,246,246,1) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(246,246,246,1) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(246,246,246,1) 100%); /* IE10+ */
    background: linear-gradient(to bottom,  rgba(255,255,255,1) 0%,rgba(246,246,246,1) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
}
<div class="steps-s3">Test</div>

于 2012-10-18T11:36:15.147 回答