布局div css实例教程

html-css029

布局div css实例教程,第1张

网上流传的,我觉得很经典了,你可以看原地址更清楚些。 CSS常用布局实例 一列 单行一列 body { margin: 0pxpadding: 0pxtext-align: center} #content { margin-left:automargin-right:autowidth: 400pxwidth: 370px} 两行一列 body { margin: 0pxpadding: 0pxtext-align: center} #content-top { margin-left:automargin-right:autowidth: 400pxwidth: 370px} #content-end {margin-left:automargin-right:autowidth: 400pxwidth: 370px} 三行一列 body { margin: 0pxpadding: 0pxtext-align: center} #content-top { margin-left:automargin-right:autowidth: 400pxwidth: 370px} #content-mid { margin-left:automargin-right:autowidth: 400pxwidth: 370px} #content-end { margin-left:automargin-right:autowidth: 400pxwidth: 370px} 两列 单行两列 #bodycenter { width: 700pxmargin-right: automargin-left: autooverflow: auto} #bodycenter #dv1 {float: leftwidth: 280px} #bodycenter #dv2 {float: rightwidth: 410px} 两行两列 #header{ width: 700pxmargin-right: automargin-left: autooverflow: auto} #bodycenter { width: 700pxmargin-right: automargin-left: autooverflow: auto} #bodycenter #dv1 { float: leftwidth: 280px} #bodycenter #dv2 { float: rightwidth: 410px} 三行两列 #header{ width: 700pxmargin-right: automargin-left: auto} #bodycenter {width: 700pxmargin-right: automargin-left: auto} #bodycenter #dv1 { float: leftwidth: 280px} #bodycenter #dv2 { float: rightwidth: 410px} #footer{ width: 700pxmargin-right: automargin-left: autooverflow: auto} 三列 单行三列 绝对定位 #left { position: absolutetop: 0pxleft: 0pxwidth: 120px} #middle {margin: 20px 190px 20px 190px} #right {position: absolutetop: 0pxright: 0pxwidth: 120px} float定位 xhtml: <div id="column1"&

这个网上的教程很多,不过再学习DIV+CSS布局之前,你要有HTML的基础

其实学起来也快,不管是视频教程还是文字教程,都那么点,一般有以下几点

第一个:布局版式,什么一列自定义宽,一列居中,二列居中,三列居中,这种

第二个:特殊属性介绍,比如float,position这种

第三个:将一些实例

直接到百度搜div+css,教程满天飞

www.w3school.com.cn www.admin5.com/html这两个

还有一个安徽做网站公司的,那里面有提供一些CSS的技巧,具体的网站我不清楚,你可以到百度搜索一下,那些技巧挺不错的。最主要的是先在上面那两个网站学好了再去看技巧 越用越美妙