用css實作圖檔和文字左右居中給,文字在圖檔下方如下圖所示:
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5yMxkTY0MGN3IDMyM2YwMTY1ADM1cTOyUGZ5UmM1EmN28CX0JXZ252bj91Ztl2Lc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
html代碼:
我是誰
我是誰
我是誰
我是誰
css代碼:
.rows{
margin:0 auto;
width:420px;
height:110px;
}
.row{
float: left;
overflow: hidden;
width: 92px;
margin:5px;
}
.item{
text-align: center;
border: 1px solid #ddd;
height: 90px;
overflow: hidden;
}
.item-a img{
width:90px;
height:90px;
}
.span-div{
margin: 0 auto;
padding: 0;
overflow: hidden;
text-align: center;
text-decoration: none;
font-weight: normal;
width: 92px;
height: 20px;
line-height: 20px;
position: relative;
}