Web前端開發,自學筆記整理
仿製臥龍控股主頁
1.原始圖片
2.仿製主頁
主頁畫面1
主頁畫面2
3.完整代碼
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>臥龍控股 | 首頁</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<!--
1.設計稿分析
- 頭部
- 導航
- 橫幅
- 新聞
- 底部
2.項目工程創建
- 創建對應的文件夾
3.根據模塊劃分,搭建頁面基本框架
4.將整體架構撐開
5.一個個模塊填充
ps截圖:
- 矩形選框(選中需要截取的)
- command + c (複製)
- command + n (新建圖層)
- command + v (粘貼)
- command + s (保存)
- 選擇保存路徑、保存類型、文件名稱
盒子模型 = content + padding + border + margin
-->
<body>
<!--1.頭部-->
<div id="header">
<div class="logo">
<a href="#">
<img src="img/logo.png" />
</a>
</div>
<div class="search">
<form>
<input type="text" value="SEARCH..." class="text"/>
<input type="submit" class="bt" value=""/>
</form>
</div>
</div>
<!--2.導航-->
<div id="nav">
<ul>
<li><a href="#">集團介紹</a></li>
<li><a href="#">產品中心</a></li>
<li><a href="#">臥龍市場</a></li>
<li><a href="#">技術研發</a></li>
<li><a href="#">國際合作</a></li>
<li><a href="#">投資者關係</a></li>
<li><a href="#">新聞資訊</a></li>
<li class="last"><a href="#">人力資源</a></li>
</ul>
</div>
<!--3.橫幅-->
<div id="banner">
<img src="img/banner.png" />
</div>
<!--4.新聞-->
<div id="news">
<div class="news1">
<div class="section1">
<h3>新聞資訊</h3>
<ul>
<li>
<a href="#">陳建成董事長出席ATB集團召開年度銷售大會</a>
<span>2013-07-30</span>
</li>
<li>
<a href="#">中國電器工業協會分馬力電機分會在臥龍召開理事長...</a>
<span>2013-07-30</span>
</li>
<li>
<a href="#">陳建成董事長訪問中國駐德大使館</a>
<span>2013-07-30</span>
</li>
<li>
<a href="#">企業文化是企業持續經營的關鍵要素</a>
<span>2013-07-30</span>
</li>
<li>
<a href="#">陳建成監事長在ATB集團2013年銷售會議上發表重要...</a>
<span>2013-07-30</span>
</li>
<li>
<a href="#">喜迎七一唱臥龍 年輕力量激發企業持久活力 臥龍舉...</a>
<span>2013-07-30</span>
</li>
</ul>
</div>
<div class="section2">
<h3>臥龍介紹</h3>
<p class="info1">公司成立於1984年,<br />經過近30年的發展</p>
<p class="info2">已成爲電器製造,房地產開發和金融<br />投資三業並舉的綜合性跨國...</p>
</div>
<div class="section3">
<h3>人才招聘</h3>
<p>培養一流人才,鑄造一流的工程<br />實現員工與企業的共同發展</p>
<a href="#">
<img src="img/more.png" />
</a>
</div>
</div>
<div class="news2">
<h3>臥龍市場</h3>
<div class="content">
<div class="smallBox">
<img src="img/new2-1.png" />
<a href="#">交通軌道: 由於主要採用電氣牽引,而且輪軌摩擦阻力較小,與公共...</a>
</div>
<div class="smallBox" style="margin: 0 39px;">
<img src="img/new2-2.png"/>
<a href="#">節能環保: 由於不斷上漲的能源消耗和我們的專業知識, 維護可持續...</a>
</div>
<div class="smallBox" style="margin-right: 39px;">
<img src="img/new2-3.png"/>
<a href="#">航空與船艦: 如果你是在公海行駛, 你需要確保你的船隻的電力系統...</a>
</div>
<div class="smallBox">
<img src="img/new2-4.png"/>
<a href="#">石油、天然氣及採礦: 在市場中的安全性,可靠性,效率和最短的停機...</a>
</div>
</div>
</div>
</div>
<!--5.底部-->
<div id="footer">
<div class="section1">
<div class="view1">
<h3>產品中心</h3>
<ul>
<li><a href="#">汽車電機</a></li>
<li><a href="#">日用電機</a></li>
<li><a href="#">特種電機</a></li>
<li><a href="#">大功率電機</a></li>
<li><a href="#">電工設備</a></li>
</ul>
<ul style="margin: 0 70px;">
<li><a href="#">工業驅動和自動化</a></li>
<li><a href="#">高壓變頻和系統集成</a></li>
<li><a href="#">混泥土攪拌機</a></li>
<li><a href="#">電動車輛</a></li>
</ul>
<ul>
<li><a href="#">電池電源</a></li>
<li><a href="#">輸變電設備</a></li>
<li><a href="#">樓盤信息</a></li>
<li><a href="#">金融產品/a></li>
</ul>
</div>
<div class="view2" style="margin: 0 50px;">
<h3>技術研發</h3>
<ul>
<li><a href="#">科技力量</a></li>
<li><a href="#">先進設備</a></li>
<li><a href="#">研發創新</a></li>
<li><a href="#">工藝流程/a></li>
</div>
<div class="view3">
<h3>銷售網絡</h3>
<img src="img/ditu.png" />
</div>
</div>
<div class="section2">
<div class="view1">
<a href="#">網站地圖</a> <span>|</span>
<a href="#">聯繫我們</a> <span>|</span>
<a href="#">關注臥龍</a> <span>|</span>
<a href="#">採購系統入口</a>
</div>
<div class="view2">
COPYRIGHT © 臥龍控股集團 版權所有 浙備ICP06005901號 技術支持: 博採互動 分享到:
<a href="#">
<img src="img/shejiao.png" />
</a>
</div>
</div>
</div>
</body>
</html>
style.css
/*重置樣式*/
* {
margin: 0;
padding: 0;
}
/*1.頭部*/
#header {
width:999px;
height: 100px;
margin: 0 auto;
}
#header .logo {
width: 249px;
height: 31px;
float: left;
margin: 39px 0 30px 19px;
}
#header .search {
width: 230px;
/*height: 31px;*/
height: 29px;
float: right;
margin: 39px 20px 31px 0;
background: #f1f1f1;
border: 1px solid #fefefe;
}
#header .search .text {
height: 29px;
width: 186px;
float: left;
padding-left: 16px;
font-size: 10px;
border: none;
background: #f1f1f1;
}
#header .search .bt {
height: 29px;
width: 26px;
float: left;
background: url(../img/searchbt.png) no-repeat left center;
border: none;
}
/*2.導航*/
#nav {
width: 999px;
height: 60px;
background: lightblue;
margin: 0 auto;
background: black;
}
#nav ul {
padding-left: 25px;
}
#nav ul li {
float: left;
list-style: none;
width: 120px;
height: 60px;
text-align: center;
border-right: 1px solid #4a4a4a;
line-height: 60px;
font-size: 13px;
}
#nav ul .last {
border-right: none;
}
#nav ul li a {
color:white;
text-decoration: none;
}
/*3.橫幅*/
#banner {
width: 999px;
height: 464px;
margin: 0 auto;
background: url(../img/banner.png);
}
/*4.新聞*/
#news {
width: 999px;
height: 548px;
margin: 0 auto;
}
#news .news1 {
width: 999px;
height: 243px;
}
#news .news1 .section1 {
width: 454px;
height: 243px;
float: left;
padding-left: 20px;
padding-right: 26px;
}
#news .news1 .section1 h3 {
height: 84px;
line-height: 84px;
font-size: 19px;
}
#news .news1 .section1 ul li{
list-style-position: inside;
list-style-image: url(../img/news1.png);
line-height: 24px;
height: 24px;
width: 454px;
font-size: 12px;
}
#news .news1 .section1 ul li a {
/*float: left;*/
text-decoration: none;
color: #5c5c5c;
}
#news .news1 .section1 ul li span {
float: right;
color: #aeaeae;
}
#news .news1 .section2 {
width: 202px;
height: 243px;
background: #f1f1f1;
float: left;
padding-left: 26px;
padding-right: 11px;
}
#news .news1 .section2 h3 {
height: 84px;
line-height: 84px;
font-size: 19px;
}
#news .news1 .section2 .info1 {
font-size: 13px;
line-height: 26px;
color: #767676;
padding-bottom: 12px;
}
#news .news1 .section2 .info2 {
font-size: 12px;
line-height: 24px;
color: #acacac;
}
#news .news1 .section3 {
width: 234px;
height: 243px;
background: #fbfbfb url(../img/bg.png) no-repeat 165px 122px;
float: left;
padding-left: 25px;
}
#news .news1 .section3 h3 {
height: 84px;
line-height: 84px;
font-size: 19px;
}
#news .news1 .section3 p {
font-size: 13px;
line-height: 26px;
color: #767676;
margin-bottom: 40px;
}
#news .news2 {
/*width: 999px;*/
width: 959px;
/*height: 305px;*/
height: 240px;
padding: 30px 20px 35px 20px;
}
#news .news2 h3 {
height: 35px;
font-size: 19px;
}
#news .news2 .content {
height: 204px;
}
#news .news2 .content .smallBox {
width: 210px;
height: 204px;
float: left;
}
#news .news2 .content .smallBox img {
margin-bottom: 15px;
}
#news .news2 .content .smallBox a {
margin-top: 18px;
font-size: 12px;
line-height: 22px;
text-decoration: none;
color: #5d5d5d;
text-align: justify;
}
/*5.底部*/
#footer {
width: 999px;
height: 331px;
margin: 0 auto;
}
#footer .section1 {
/*width: 999px;*/
width: 959px;
/*height: 250px;*/
height: 220px;
background: #e5e5e5;
padding: 30px 20px 0 20px;
}
#footer .section1 h3 {
height: 28px;
padding-left: 12px;
font-size: 16px;
font-weight: normal;
color: #595959;
border-bottom: 1px solid #c2c2c2;
margin-bottom: 20px;
}
#footer .section1 .view1 {
width: 453px;
height: 220px;
float: left;
}
#footer .section1 ul {
float: left;
}
#footer .section1 ul li {
list-style: url(../img/list.png) inside;
margin-bottom: 12px;
}
#footer .section1 ul li a {
text-decoration: none;
font-size: 12px;
color: #595959;
}
#footer .section1 .view2 {
width: 152px;
height: 220px;
float: left;
}
#footer .section1 .view3 {
width: 250px;
height: 220px;
float: left;
}
#footer .section1 .view3 img {
margin: 12px 0 0 30px;
}
#footer .section2 {
/*width: 999px;*/
width: 959px;
height: 81px;
padding: 0 20px;
}
#footer .section2 .view1 {
width: 290px;
height: 57px;
float: left;
padding-top: 25px;
}
#footer .section2 .view1 a {
font-size: 12px;
color: #888888;
text-decoration: none;
}
#footer .section2 .view1 span {
font-size: 12px;
color: #888888;
margin: 0 5px;
}
#footer .section2 .view2 {
width: 530px;
height: 56px;
float: right;
padding-top: 26px;
font-size: 10px;
color: #888888;
text-align: right;
}