1.正方形
css
<div class="square"></div>
css
.square {
width: 100px;
height: 100px;
background-color: #ffff00;
}
效果:

2.长方形
html
<div class="rectangle"></div>
css
.rectangle{
width: 200px;
height: 100px;
background-color: #ff0000;
}

3.菱形
html
<div class="rhombus"></div>
css
.rhombus{
width: 100px;
height: 100px;
transform: rotate(45deg);
background-color: #ffff00;
}

4.三角形
html
<div class="triang"></div>
css
.triang{
width: 0px;
height: 0px;
border: 40px solid transparent;
border-bottom: 40px solid #ff0000;
}

5.梯形
html
<div class="trapezoid"></div>
css
.trapezoid {
width: 100px;
height: 0px;
border: 40px solid transparent;
border-bottom: 40px solid #ff0000;
}
