css 角标样式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
}
.contaier {
width: 800px;
height: 500px;
margin: 50px auto;
border: 1px solid red;
background: #ededed;
padding: 50px;
border-radius: 10px;
}
ul {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
align-items: center;
}
/* 最后一行不两端对齐 */
ul:after {
content: "";
flex: auto;
}
li {
list-style: none;
float: left;
height: 36px;
line-height: 36px;
background: green;
color: #fff;
font-size: 16px;
margin: 10px;
text-align: center;
padding: 0 14px;
border-radius: 18px;
}
</style>
</head>
<body>
<div class="contaier">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>10</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
<li>11</li>
<li>10</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
<li>11</li>
<li>10</li>
<li>121</li>
<li>131</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>1421</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
<li>14221</li>
</ul>
</div>
</body>
</html>
效果:
![](https://img2020.cnblogs.com/blog/2523048/202110/2523048-20211013174519315-185003194.png)