srain-c
11/21/2014 - 1:41 AM

CSS伪类, 运用伪类能够达到一些意想不到的效果。

CSS伪类, 运用伪类能够达到一些意想不到的效果。

.slide_item:before {
    content:"";
    display:block;
    overflow:hidden;
    background:#1A1A1A;
    position:absolute;
    top:50%;
    left:50%;
    margin-left:-40px;
    height:2px;
    width:80px;
    -webkit-box-sizing:content-box;
    -moz-box-sizing:content-box;
    -ms-box-sizing:content-box;
    box-sizing:content-box; //盒模型
}

.loading:after {
    content: " ";
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: .7;
}
.loading:before {
    content: " ";
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    margin: -3px 0 0 -33px;
    width: 66px;
    height: 6px;
    background: url("../images/loading.gif") no-repeat top left;
}