<div class="demo1"> <div class="left">定宽</div> <div class="right">自适应</div> </div>
@mixin common{ line-height: 100px; height: 100px; text-align: center; color: white; } .demo1{ @include common; .left{ background-color: red; float: left; width: 100px; } .right{ margin-left: 100px; background-color: blue; } }