我们可以看出通常的页面布局有以下几个部分:头部、内容、底部,其中内容有左侧主显区和右侧边栏。下面贴出代码:
复制代码代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>DIV+CSS practice</title>
<link href="css/common.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
<!-- 头部 -->
<div id="head">
</div>
<!--END 头部 -->
<!-- 主容器 -->
<div id="container">
<!-- 左侧主显区 -->
<div id="content">
</div>
<!-- END 左侧主显区 -->
<!-- 右侧边栏 -->
<div id="side">
</div>
<!-- END 右侧边栏 -->
</div>
<!-- END 主容器 -->
<div class="clear"></div>
<!-- 底部 -->
<div id="foot">
</div>
<!-- END 底部 -->
</body>
</html>
common.css样式文件:
*{
margin:0;
padding:0;
}
body{
background-color:gray;
}
.clear{
clear:both;
}
/*head*/
#head{
background-color:blue;
height:150px;
}
/*container*/
#container{
background-color:red;
width:960px;
height:800px;
margin:20px auto;
}
/*content*/
#content{
background-color:yellow;
float:left;
width:685px;
height:100%;
}
/*side*/
#side{
background-color:green;
float:right;
width:255px;
height:100%;
}
/*foot*/
#foot{
background-color:white;
height:150px;
width:960px;
margin:20px auto;
}
大致布局很简单了,首先要有这个大局观,然后再完善其中的细节,学习PHP或者其他语言同样如此,首先要有一个思想,知道每一步做什么,怎么做,这样才能把知识灵活运用。
样式布局
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]