用flex来布局,设置justify-content: center
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
.gorup{
display: flex;
flex-wrap: wrap;
width: 240px;
justify-content: center;
}
.gorup>div{
margin-bottom: 10px;
margin-right: 1px;
width: 40px;
height: 50px;
text-align: center;
line-height: 50px;
color: #fff;
}
.gorup>div>span{
display:inline-block;
width: 50px;
height: 50px;
background: gainsboro;
border-radius: 50%;
border: 1px solid red;
}
</style>
</head>
<body>
<div class="gorup">
<div><span>1</span></div>
<div><span>2</span></div>
<div><span>3</span></div>
<div><span>4</span></div>
<div><span>5</span></div>
<div><span>6</span></div>
<div><span>7</span></div>
<div><span>8</span></div>
<div><span>9</span></div>
</div>
</body>
</html>