一懊蒸、??作品介紹
HTML實(shí)例網(wǎng)頁代碼, 本實(shí)例適合于初學(xué)HTML的同學(xué)。該實(shí)例里面有設(shè)置了css的樣式設(shè)置疤估,有div的樣式格局,這個(gè)實(shí)例比較全面霎冯,有助于同學(xué)的學(xué)習(xí),本文將介紹如何通過從頭開始設(shè)計(jì)個(gè)人網(wǎng)站并將其轉(zhuǎn)換為代碼的過程來實(shí)踐設(shè)計(jì)铃拇。
二、??作品效果
??視頻演示
https://live.csdn.net/v/embed/239889
(title-D24JP- 故宮介紹(6頁))
?? 截圖演示
06.png
05.png
04.png
03.png
02.png
01.png
三沈撞、?? 作品代碼
??HTML代碼
<!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>首頁-the Imperial Palace</title>
<meta name="keywords" content="the Imperial Palace" />
<meta name="description" content="the Imperial Palace" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="top">
<div class="logo"><a href="index.html"><img src="images/logo.png" height="60" /></a></div>
<div class="webnav">
<ul>
<li class="licur"><a href="index.html" title="網(wǎng)站首頁">網(wǎng)站首頁</a></li>
<li><a href="list.html" title="景點(diǎn)列表">景點(diǎn)列表</a></li>
<li><a href="lyeat.html" title="景點(diǎn)小吃">景點(diǎn)小吃</a></li>
<li><a href="lygl.html" title="旅游攻略">旅游攻略</a></li>
<li><a href="vod.html" title="視頻欣賞">視頻欣賞</a></li>
<li><a href="lx.html" title="投訴建議">投訴建議</a></li>
</ul>
</div>
<div style="clear:both"></div>
</div>
<div class="banner">
<img src="images/banner.jpg" height="279" width="1000" />
</div>
<div class="index_con">
<div class="left">
<div class="jsbox">
<h3 class="s1"><span class="s1">故宮簡介</span></h3>
<div class="js_con">
北京故宮是中國明清兩代的皇家宮殿慷荔,舊稱紫禁城,位于北京中軸線的中心缠俺。北京故宮以三大殿為中心显晶,占地面積72萬平方米贷岸,建筑面積約15萬平方米,有大小宮殿七十多座磷雇,房屋九千余間 偿警。
京故宮是世界上現(xiàn)存規(guī)模最大、保存最為完整的木質(zhì)結(jié)構(gòu)古建筑之一唯笙,是國家AAAAA級旅游景區(qū)螟蒸, 1961年被列為第一批全國重點(diǎn)文物保護(hù)單位; 1987年被列為世界文化遺產(chǎn)崩掘。</div>
</div>
<div class="pic_box">
<h3 class="s3"><span class="s3">故宮美景</span></h3>
<script src="js/jquery-1.4.3.min.js"></script>
<script src="js/jQuery-jcMarquee.js" type="text/javascript"></script>
<script>
$(function(){
$('#Marquee_x').jcMarquee({ 'marquee':'x','margin_right':'10px','speed':20 });
// DIVCSS5提示:10px代表間距七嫌,第二個(gè)20代表滾動速度
});
</script>
<div class="pic_con" id="Marquee_x">
<ul>
<li>
<div><a href="#" target="_blank">
<img src="images/1.jpg" />
</a>
<span>故宮全景</span>
</div>
<div><a href="#" target="_blank">
<img src="images/2.jpg" />
</a>
<span>武英殿</span>
</div>
<div><a href="#" target="_blank">
<img src="images/3.jpg" />
</a>
<span>文華殿</span>
</div>
<div><a href="#" target="_blank">
<img src="images/4.jpg" />
</a>
<span>景仁宮</span>
</div>
<div><a href="#" target="_blank">
<img src="images/5.jpg" />
</a>
<span>御花園</span>
</div>
<div><a href="#" target="_blank">
<img src="images/6.jpg" />
</a>
<span>珍寶館</span>
</div>
<div><a href="#" target="_blank">
<img src="images/7.jpg" />
</a>
<span>慈寧宮</span>
</div>
<div><a href="#" target="_blank">
<img src="images/8.jpg" />
</a>
<span>神武門</span>
</div>
</li>
</ul>
</div>
</div>
<div class="about">
<h3 class="s3"><span class="s3">關(guān)于我們</span></h3>
<div class="about_con">
<p><span class="a1">網(wǎng)站名稱:</span><span class="b1">故宮旅游網(wǎng)</span></p>
<p><span class="a1">學(xué)校名稱:</span>xxxx</p>
<p><span class="a1">地址:</span>xxxx</p>
<p><span class="a1">姓名:</span><span class="b1">xxxxx</span></p>
</div>
</div>
</div>
<div class="right">
<div class="lb_box">
<h3 class="s2"><span class="s2">今日推薦</span></h3>
<div class="lb_con">
<img src="images/1.jpg" />
</div>
</div>
<div class="list_box">
<h3 class="s2"><span class="s2">相關(guān)資訊</span></h3>
<div class="list_con">
<ul>
<li class="news"><a href="#">故宮游覽路線</a></li>
<li class="news"><a href="#">故宮的歷史介紹</a></li>
<li class="news"><a href="#">今日故宮開放景點(diǎn)</a></li>
<li class="news"><a href="#">故宮四季旅游介紹</a></li>
<li class="news"><a href="#">故宮季節(jié)美景觀賞</a></li>
</ul>
</div>
</div>
</div>
<div style="clear:both"></div>
</div>
<div class="footer">
<p>Copyright © 2019-2020,xxx, All Rights Reserved</p>
</div>
<embed src="images/All.mp3" width="1" height="1" type="audio/mpeg" loop="true" autostart="true">
</body>
</html>
??CSS代碼
body, p, form, h1, h2, h3, h4, h5, h6, td, th, table, div, ul, li, ol, dl, dt, dd, input, select { margin:0;padding:0;}
body{ font-size:12px; font-family:Arial, Helvetica, sans-serif; color:#333333; background:#f8f8f8}
a:link, a:visited {text-decoration:none; color:#585858;}
a:hover {text-decoration:none;color:#0766A6;}
.border01{ border:#E3E3E3 1px solid;}
img {border:0;}
ul,ul li{list-style-type:none;}
.clear {clear:both;height:0px;line-height:0;padding:0;border:0;overflow:hidden;font-size: 0px;}
.blank10 {height:10px;overflow:hidden;line-height:0;font-size:0;clear:both;}
h1,h2,h3,h4,h5,h6{ font-size:14px; font-weight:bold;}
.font14{ font-size:14px;}
/*網(wǎng)站頭部*/
.top{ width:1002px; margin:auto; border-bottom:2px solid #006699; background:#EAEAEA; }
.logo{ float:left; width:350px; height:60px; overflow:hidden;display:inline;}
.righttel{ float:right; width:200px; height:30px; overflow:hidden; margin-right:40px; margin-top:10px; display:inline;}
.webnav{ float:right; text-align:right; height:60px; line-height:60px; overflow:hidden;}
.webnav ul{padding-right:20px;}
.webnav li{ float:left;height:60px; line-height:60px; font-family:'微軟雅黑',Arial; font-weight:bold;margin-right:10px; padding-left:10px; padding-right:10px; font-size:14px}
.webnav li a{ display:block}
.webnav li a:link,.webnav li a:visited{ color:#0766A6;}
.webnav li:hover{ background:#0E7CB0; color:#FFFFFF}
.webnav li a:hover{color:#FFFFFF}
.banner{ width:1002px; margin:0 auto; margin-top:10px; }
.banner img{ width:1000px; height:279px;}
/*首頁主體內(nèi)容*/
.index_con{ width:1002px; margin:0 auto; margin-top:15px;}
.jsbox{ width:660px; background:#FFFFFF; border:1px solid #CCCCCC}
h3.s1{ height:30px; padding-left:20px; background:#526B37; line-height:30px; font-size:14px; font-weight:900; }
.js_con{ padding:20px 10px; text-indent:2em; font-size:12px; background:#EBE7D7; line-height:180%}
.index_con .left{ float:left; width:660px;}
.index_con .right{ float:right; width:330px;}
span.s1{ display:block; width:120px; height:30px; text-align: center; padding:0px 6px; background:#E7E2CE; color:#323126}
.lb_box{width:330px;}
.lb_con{ width:300px; margin:0 auto; padding:0px 15px; background:#EBE7D7}
.lb_con img{ width:300px;height:288px;}
h3.s2{ height:25px; padding-left:20px; padding-top:5px; background:#D5C794; font-size:14px; font-weight:900; border-bottom:2px solid #526B37 }
span.s2{ display:block; width:120px; height:25px;line-height:25px;text-align: center; padding:0px 6px; background:#526B37; color: #FFFFFF;
border-top-left-radius: 5px;border-top-right-radius: 5px;}
.pic_box{width:660px; background:#FFFFFF; border:1px solid #CCCCCC; margin-top:20px;}
.pic_con{ padding:10px 10px; background:#EBE7D7; }
#yj img{ max-width:638px; display:block; margin:0 auto}
/*圖片滾動*/
#mrq{width:640px; margin:20px auto;border:1px solid #000; padding:2px}
#Marquee_x { overflow:hidden;}
#Marquee_x ul li ,#Marquee_x ul li div{ float:left;line-height:25px;overflow:hidden} /* 橫向滾動必須讓所有l(wèi)i左浮動 */
#Marquee_x ul li div{ float:left;line-height:25px; width:160px; overflow:hidden}
#Marquee_x ul li div img{ border:1px solid #DADADA; width:160px; height:120px; display:block}
#Marquee_x ul li div span{ display:block; text-align:center}
#n{margin:10px auto; width:920px; border:1px solid #CCC;font-size:12px; line-height:30px;}
#n a{ padding:0 4px; color:#333}
.js_t {
height: 30px;
border: 1px solid #CCCCCC;
padding-left: 10px;
line-height: 30px;
border-left: 20px solid #6699FF;
font-size: 16px;
font-weight: bold;
}
.js_c {
line-height: 30px;
color: #333333;
font-size: 14px;
background: #FFFFFF;
border: 2px dashed #CCCCCC;
margin-top: 10px;
margin-bottom: 20px;
}
.js_c p {
text-indent: 2.0em; padding:5px;
}
.js_c img{ text-indent:0; width:95%; margin:0 auto}
.about{width:660px; background:#FFFFFF; border:1px solid #CCCCCC; margin-top:20px;}
.about_con{ padding:10px 10px; background:#EBE7D7; }
h3.s3{ height:25px; padding-left:20px; padding-top:5px; background:#F2F2F2; font-size:14px; font-weight:900; border-bottom:1px solid #023C7E}
span.s3{ display:block; width:120px; height:25px; line-height:25px; text-align: center;
padding:0px 6px; background:#526B37; color: #FFFFFF;
border-top-left-radius: 5px;border-top-right-radius: 5px;
}
.about p{ margin:6px 0px; background:#F8F8F8; padding:6px; border:1px dashed #CCCCCC}
span.a1{ font-size:14px; color:#333333; font-weight:bold;}
span.b1{ font-size:14px; color:#333333; font-weight:500;}
.list_box{ margin-top:10px;}
.list_con ul {
background: #fff;
padding: 5px 10px 5px 10px;
border: 1px solid #ccc;
}
ul li.news {
height: 30px;
line-height: 30px;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
padding-left: 15px;
background: url(../images//new.gif) no-repeat scroll 1px 10px;
font-size: 12px;
}
ul li.news:hover{text-decoration:underline;color: #6666FF}
ul li.news a:link{ color:#333333; text-decoration:none}
ul li.news a:hover{ color: #6666FF}
.wrapper{margin: 0 auto;
width: 1000px;
margin-top: 10px;}
.wrapper .left{float: left;
width: 660px; border:1px solid #CCCCCC}
.wrapper .right{float: right;
width: 330px;}
h1.s1{ height:38px; line-height:38px; text-align: center; border-bottom:1px solid #526B37; background:#f5f5f5; color:#333333; font-size:16px; font-weight:bold}
.pic_dt{ width:300px; height:288px; padding:0px 15px}
.pic_dt img{ width:300px; height:288px}
.art_con{ padding:10px; font-size:12px; line-height:30px; background:#FFFFFF}
#wzpoint{ position:absolute; top:155px; color:#FF0000; left:361px; width:100px; height:50px; line-height:50px; font-size:24px;}
.footer{ width:1002px; text-align: center; margin:0 auto; margin-top:20px; border-top: 2px solid #526B37; background:#EBE7D7}
.footer p{ padding:10px 0px; font-size:14px; color:#000000}
/*文章列表頁面*/
.art_list{ padding:10px;}
.post_box {
padding: 10px 10px;
margin-bottom: 10px;
background: #FFFFFF;
border: 1px solid #CCCCCC;
border-radius: 5px;
box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}
.post_img {
float: left;
height: 100px;
width: 120px;
margin-right: 10px;
}
.post_img img {
width: 120px;
height: 100px;
border-radius: 4px;
}
.post_body {
min-height: 100px;
}
.post_t {
line-height: 20px;
font-size: 17px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.post_p {
color: #999;
min-height: 60px;
font-size: 12px;
word-wrap: break-word;
line-height: 20px;
margin-bottom: 6px;
}
.post_meta {
float: right;
padding: 0px 6px;
font-size: 12px;
color: #2E2821;
}
四、??更多源碼
【干貨分享】自學(xué)編程的小伙伴可以前往我的 gitee 倉庫(持續(xù)更新中...)
??【web學(xué)習(xí)指南】從web基礎(chǔ)苞慢、計(jì)算機(jī)基礎(chǔ)到前端常用框架的教程诵原,涵蓋前端大部分必備知識(學(xué)習(xí)指南 + 技術(shù)文章 + 資源分享)
Gitee倉庫地址(來個(gè)Star吧~): https://gitee.com/zhanyuqiu2022/my-app