// 清除浮动
.clear() {
    & when (@compat_ie7 = true) {
        *zoom: 1;
    }

    &:after {
        content: '';
        display: table; //IE9.js在为IE6-7做兼容时会生成一个元素来模拟伪元素，空的table元素将不会产生高度
        clear: both;
    }
}

// 锁定顶部（IE6-7不存在此问题）
.fix() {
    &:before {
        content: '';
        display: table;
    }
}

// 清除浮动并锁定顶部和底部
.clearfix() {
    & when (@compat_ie7 = true) {
        *zoom: 1;
    }

    &:before,
    &:after {
        content: '';
        display: table;
    }
    &:after { clear: both; }
}
