实现方法:
(推荐教程:html教程)
1、文本居中:text-align: center;
line-height: 100px; (=height)
2、标签居中margin: 0 auto; 其中0指的是margin-top:0
具体代码:
搜索论坛.item1{
height: 100px;
width: 100px;
background-color: red;
text-align: center;
line-height: 100px;
margin: 0 auto;
}
.item2{
height: 100px;
width: 100px;
background-color: wheat;
text-align: center;
line-height: 100px;
margin: 100px auto;
}
1111
2222