首页 > 开发 > CSS > 正文

Div+CSS 布局入门教程之二 构建网站

2024-07-11 08:26:59
字体:
来源:转载
供稿:网友
首先需要规划网站,本教程将以下图为例构建网站。

其基本布局见下图:


主要由五个部分构成:
1.Main Navigation 导航条,具有按钮特效。 Width: 760px Height: 50px
2.Header 网站头部图标,包含网站的logo和站名。 Width: 760px Height: 150px
3.Content 网站的主要内容。 Width: 480px Height: Changes depending on content
4.Sidebar 边框,一些附加信息。 Width: 280px Height: Changes depending on
5.Footer 网站底栏,包含版权信息等。 Width: 760px Height: 66px



第二步:创建html模板及文件目录等

1.创建html模板。代码如下:

<!--Example Source Code-->
<!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=UTF-8" />
<title>Div+Css</title>
<meta http-equiv="Content-Language" content="en-us" /> 
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="true" /> 
<meta name="description" content="Description" />
<meta name="keywords" content="Keywords" /> 
<meta name="author" content="Enlighten Designs" />
<style type="text/css" media="all">@import "css/master.css";</style>
</head>
<body>
</body>
</html>

 

将其保存为index.html,并创建文件夹css,images,网站结构如下:


2.创建网站的大框:
建立一个宽760px的盒子,它将包含网站的所有元素。
在html文件的和之间写入

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表