DIV+CSS是WEB设计标准,它是一种网页的布局方法,能很好的实现内容与表现的分离。
1. div+css布局的常用技巧
1.1. 文字垂直居中
单行文字
#cc{
background-color: red;
width: 500px;
height: 300px;
margin: 0px auto;
text-align: center;
line-height: 300px;
}
多行文字
#cc{
background-color: red;
width: 500px;
height: 300px;
margin: 0px auto;
text-align: center;
display:table-cell;
vertical-align:middle;
}





评论