DIV+CSS网页布局技巧实例1:设置网页整体居中的代码

以前用表格布局时设置网页居中非常方便,把表格对齐方式设置为居中就行了,就这么简单,现在呢,用DIV+CSS样式表控制,好像不是那么容易了,其实也很简单,只不过方式不同而已。

 

1 <style>
2 #layout { 
3     width:778px; 
4     margin:0 auto; 
5     text-align:center;
6 }
7 </style>
8 <div id="layout">设置网页整体居中的代码</div>

 

posted @ 2019-03-06 15:51  我有满天星辰  阅读(643)  评论(0编辑  收藏  举报