DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> CSS入門知識 >> CSS詳解
實例解析:用 DIV CSS 布局重現 Google 首頁(下)
編輯:CSS詳解     

第三部分、完整程式碼

將前面的分析整合起來,完整程式碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>Google</title>
<style type="text/css">
body{
 background:#FFF;
 color:#000;
 font-family:Arial,sans-serif;
 font-size:13px;
 text-align:center;
 margin-top:3px;
}
a:link{
 color:#00C;
}
a:visited{
 color:#551a8b;
}
#login{
 text-align:right;
}
#stype{
 margin-bottom:4px;
}
#stype span{
 padding:0 6px;
}
#search{
 margin:0 auto;
 width:400px;
 position:relative;
}
#more{
 width:4em;
 position:absolute;
 top:0;
 right:-4.5em;
}
#ft{
 margin:54px auto 16px;
}
</style>
</head>

<body>
<div style="text-align:right"><a href="ig">個性化主頁</a>|<a href="MyAccount">
我的帳戶</a>|<a href="logout">退出</a></div>
<div style="margin:4px auto 19px;">
<img src="logo.gif" alt="Google"/></div>
<div id="stype"><span><strong>網頁</strong></span><span><a href="pic">圖片</a>
</span><span><a href="info">資訊</a></span><span><a href="group">論壇</a></span><span>
<a href="more"><strong>更多»</strong></a></span></div>
<form id="search" action="" method="post">
<div><input type="text" size="55" title="Google 搜尋"/></div>
<div><button type="submit">Google 搜尋</button><button>手氣不錯</button></div>
<div style="margin-top:6px;"><label><input type="radio" name="t" checked="checked"/>
搜尋所有網頁</label><label><input type="radio" name="t"/>中文網頁</label><label>
<input type="radio" name="t"/>簡體中文網頁</label></div>
<div id="more"><a href="advanced_search">高級搜尋</a>
<a href="pref">使用偏好</a><a href="lang">語言工具</a></div>
</form>

<div id="ft"><a href="ad">廣告計劃</a>-<a href="all">
Google 大全</a>-<a href="en">Google.com in English</a></div>
<div>©2007 Google</div>
</body>
</html>

【編輯推薦】

  • DIV CSS 實例教學要點總結
  • 解析 DIV 佈局之四大屬性用法
  • HTML 中 DIV 和 Span 的差別揭秘
  • 使用 Div CSS 架構的三大好處
  • Div CSS 實例教學:頁面製作方法全程指導

【責任編輯:程華權 TEL:(010)68476606】

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved