Home >Web Front-end >HTML Tutorial >div CSS completes the web page layout (top, bottom, left, and right)_html/css_WEB-ITnose

div CSS completes the web page layout (top, bottom, left, and right)_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:29:121862browse

 


< html  xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< meta  http-equiv ="Content-Type"  content ="text/html; charset=gb2312"   />
< title > 无标题文档
< style  type ="text/css" >
body {
margin : 0 ;
padding : 0 ;
}
#head {
height : 40px ;
background-color : #0033CC ;
width : 800px ;
margin : 0 ;
}
#content {
width : 800px ;
background : #CCCCCC ;
height : 200px ;
margin : 0 ;
}
#left {
top : 40px ;
width : 150px ;
height : 200px ;
background : #CCCC66 ;
float : left ;
margin : 0 ;
}
#c {
width : 500px ;
height : 200px ;
background : #FFFFFF ;
margin : 0 ;
}
#right {
width : 150px ;
height : 200px ;
background : #339966 ;
float : right ;
margin : 0 ;
}
#foot {
width : 800px ;
background : #0099CC ;
height : 40px ;
margin : 0 ;
}


< body >
< div  id ="head" > head
< div  id ="content" >
   < div  id ="left" > left
   < div  id ="c" > content
   < div  id ="right" > rigth

< div  id ="foot" > foot



 

 

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn