不同项目的布局是不一样滴!
在项目空白处,新建一个“index.html”文件,写H5的代码,写页面的整体布局。参考代码如下所示:
<!-- 设计页面的布局;outer:是一个整体的标记ID,这个ID就像我们的身份证一样,唯一的; div完毕之后,按下Tab键,可以出来标签; div:是一个空白块的概念;要让它出来,需要设置宽 高,这是必须的; 绝招:设置它的背景色或者边框; 网页的化妆品:样式表; --> <div id="outer"> <div id="header"></div> <div id="content"></div> <div id="footer"></div> </div>在css子目录右键,新建一个index.css的样式文件。参考代码如下所示:
body{background-color: brown; margin: 0;}#outer{ width:1024px;height: 1000px; background-color: antiquewhite; margin:0 auto;}#header{ width: 1024px;height: 100px; background-color: #f0f;}#content{ width: 1024px;height: 800px; background-color: #00f;}#footer{ width: 1024px;height: 100px; background-color: #000;}在index.html增加对外部样式的链接,<link rel=”stylesheet” href=’./css/index.css’/>效果参考


