less 文件内容
@charset "utf-8";
//定义变量
@test-width:200px;
@test-height:300px;
//定义样式
.testDiv{
width:@test-width;
height:@test-height;
background-color: aquamarine;
}
html 文件
<body>
<div class="testDiv"></div>
</body>
less 文件内容
@charset "utf-8";
//定义变量
@test-width:200px;
@test-height:300px;
//定义样式
.testDiv{
width:@test-width;
height:@test-height;
background-color: aquamarine;
}
<body>
<div class="testDiv"></div>
</body>