首页 > 分享 > 211. 大学生HTML5期末大作业 ―【 可爱的宠物狗主题网页(22页)】 Web前端网页制作 html5+css3+js

211. 大学生HTML5期末大作业 ―【 可爱的宠物狗主题网页(22页)】 Web前端网页制作 html5+css3+js

目录

一、网页概述

二、网页文件

三、网页效果

四、代码展示

1.html

2.CSS

3.JS

五、总结

1.简洁实用

2.使用方便

3.整体性好

4.形象突出

5.交互式强

欢迎来到我的CSDN主页!Web前端网页制作、学生期末大作业、课程设计、毕业设计、网页模版源码、学习资料等,更多优质博客文章、网页模板点击以下链接查阅:

仙女网页设计-CSDN博客

 5000+完整代码,主题涵盖30+种类型:

一、网页概述

宠物狗主题网页设计实例,应用html5+css3+js: Div、导航栏、三级菜单、选项卡、图片轮翻效果、留言表单等。支持如Dreamweaver、HBuilder、Text 、Vscode 等任意html编辑软件进行编辑修改;支持包括IE、Firefox、Chrome、Safari主流浏览器浏览。

二、网页文件

本网页实例共包含22个页面:

三、网页效果

以下是本篇文章正文内容,下面案例仅供参考(节选示例):

四、代码展示

1.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="css/style.css" />
<script src="js/js.js" type="text/javascript"></script>
<title>狗狗百科</title>
</head>
<body>
<div class="wrapin"> <a href="#" class="logo"><img src="images/logo.png"/></a> </div>
<div class="wrapin">
<header  class="clearfix">
  <h2>狗狗百科</h2>
  <ul class="clearfix nav">
    <li><a href="index.html">网站首页</a></li>
    <li><a href="fenlei.html">狗狗分类</a></li>
    <li><a href="zixun.html">狗狗资讯</a></li>
    <li><a href="yongpin.html">狗狗用品</a></li>
    <li><a href="lianxi.html">联系我们</a></li>
  </ul>
</header>
<div class="banner_box ">
  <div class="box-1">
    <ul>
      <li> <img src="images/banner1.jpg"></img> </li>
      <li> <img src="images/banner2.jpg"></img> </li>
      <li> <img src="images/banner3.jpg"></img> </li>
      <li> <img src="images/banner4.jpg"></img> </li>
    </ul>
  </div>
  <div class="box-2">
    <ul>
    </ul>
  </div>
  <div class="box-3"> <span class="prev"> < </span> <span class="next"> > </span> </div>
</div>
<div class="con">
  <div class="top clearfix">
    <div class="jians">
      <div class="title">
        <h2>狗</h2>
      </div>
      <div class="text"> <img src="images/img_01.jpg" width="120"  class="lt"/> 狗(拉丁文Canis lupus familiaris)属于脊索动物门、脊椎动物亚门、哺乳纲、真兽亚纲、食肉目、裂脚亚目、犬科动物。中文亦称“犬”,狗分布于世界各地。狗与马、牛、羊、猪、鸡并称“六畜”。有科学家认为狗是由早期人类从灰狼驯化而来,驯养时间在4万年前~1.5万年前。被称为“人类最忠实的朋友”,是饲养率最高的宠物,其寿命大约在12~18年  。在中国文化中,狗属于十二生肖之一,在十二生肖中的第11位。 </div>
    </div>
    <div class="news_in">
      <div class="title">
        <h2>狗狗资讯</h2>
      </div>
      <ul>
        <li><a href="zixun_2.html">比利时牧羊犬的细节</a></li>
        <li><a href="zixun_3.html">大丹犬智商 大丹犬性格大揭秘</a></li>
        <li><a href="zixun_4.html">养狗,我劝你不要养“茶杯犬”,不然你会和我一样</a></li>
        <li><a href="zixun_5.html">狗狗喝咖啡也会中毒,一旦喝下这个量,狗狗可能会</a></li>
        <li><a href="zixun_6.html">开朗的狗狗突然不开心,它情绪低落有这3个原因,</a></li>
      </ul>
    </div>
  </div>
  <div class="tupian">
    <div class="title">
      <h2>狗狗美图</h2>
    </div>
    <ul class="clearfix">
      <li> <img src="images/img_02.jpg"/> </li>
      <li> <img src="images/img_03.jpg"/> </li>
      <li> <img src="images/img_04.jpg"/> </li>
    </ul>
  </div>
  <footer>狗狗百科</footer>
</div>
</body>
</html>

...

2.CSS

代码如下(节选示例):

* {
    margin: 0;
    padding: 0;
}
body {
    margin: 0 auto;
    font-size: 14px;
    background: #fff;
    color: #333;
    position: relative;
}
img {
    border: none;
}
a {
    cursor: pointer;
    color: #333;
    text-decoration: none;
    outline: none;
}
ul {
    list-style-type: none;
}
em {
    font-style: normal;
}
.lt {
    float: left;
}
.rt {
    float: right;
}
div.clear {
    font: 0px Arial;
    line-height: 0;
    height: 0;
    overflow: hidden;
    clear: both;
}
.clearfix::after {
    content: "";
    display: block;
    clear: both;
}
.wrapin {
    width: 1000px;
    margin-left: auto;
    margin-right: auto;
}
.logo {
    display: block;
    width: 160px;
    margin: 10px auto;
}
.logo img {
    width: 100%;
}
header {
    height: 50px;
    padding: 0 15px;
    background: #71a5b0;
}
header h2 {
    float: left;
    font-size: 24px;
    color: #fff;
    line-height: 50px;
}
.nav {
    float: right;
    line-height: 50px;
    text-align: center;
}
.nav li {
    display: inline-block;
    width: 120px;
    font-size: 16px;
    text-align: center;
}
.nav li a {
    color: #fff;
}
.banner {
    width: 100%;
}
.banner img {
    width: 100%;
}
.banner img {
    width: 100%;
    display: block;
    object-fit: cover;
}
.banner_box {
    width: 100%;
    height: 520px;
    overflow: hidden;
    position: relative;
}
.box-1 ul {
}
.box-1 ul li {
    width: 100;
    height: 520px;
    position: relative;
    overflow: hidden;
}
.box-1 ul li img {
    display: block;
    width: 100%;
    object-fit: cover;
    height: 100%;
}
.box-1 ul li h2 {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 40px;
    width: 100%;
    background: rgba(125,125,120,.4);
    text-indent: 2em;
    padding-right: 500px;
    font-size: 15px;
    line-height: 40px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    font-weight: normal;
    color: ghostwhite
}
.box-2 {
    position: absolute;
    right: 10px;
    bottom: 14px;
}
.box-2 ul li {
    float: left;
    width: 12px;
    height: 12px;
    overflow: hidden;
    margin: 0 5px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    text-indent: 100px;
    cursor: pointer;
}
.box-2 ul .on {
    background: rgba(255,255,255,0.6);
}
.box-3 span {
    position: absolute;
    color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 80px;
    top: 50%;
    font-family: "宋体";
    line-height: 80px;
    font-size: 60px;
    margin-top: -40px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
}
.box-3 .prev {
    left: 10px;
}
.box-3 .next {
    right: 10px;
}
.box-3 span::selection {
    background: transparent;
}
.box-3 span:hover {
    background: rgba(255,255,255,.5);
    color: rgba(255,255,255,1)
}
.con {
    margin-top: 20px;
}
.title {
    padding: 15px 0;
    color: #71a5b0;
    border-bottom: 2px solid #71a5b0;
}
.title h2 {
    font-size: 20px;
}
.jians {
    width: 49%;
    float: left;
}
.jians .text {
    padding: 15px 0;
    font-size: 14px;
    color: #333;
    line-height: 26px;
}
.news_in {
    width: 49%;
    float: right;
}
.news_in li {
    line-height: 40px;
    border-bottom: 1px dashed #ccc;
}
.news_in li a {
    color: #333;
    font-size: 14px;
}
.news_in li a:hover {
    color: #f29721;
}
footer {
    background: #71a5b0;
    text-align: center;
    line-height: 50px;
    font-size: 16px;
    color: #fff;
}
.tupian ul {
    margin: 0 -15px;
}
.tupian ul li {
    width: 33.333%;
    float: left;
    padding: 15px;
    box-sizing: border-box;
}
.tupian ul li img {
    width: 100%;
    height: 195px;
    object-fit: cover;
    border: 1px solid #ccc;
}
.tupian ul li p {
    line-height: 30px;
    text-align: center;
    font-size: 16px;
    color: #333;
}

...

3.JS

代码如下(节选示例):

// JavaScript Document

    window.onload = function(){

            function $(param){

                if(arguments[1] == true){

                    return document.querySelectorAll(param);
                }else{

                    return document.querySelector(param);
                }
            }
            var $box = $(".box");
            var $box1 = $(".box-1 ul li",true);
            var $box2 = $(".box-2 ul");
            var $box3 = $(".box-3");
            var $length = $box1.length;

                         var str = "";
            for(var i =0;i<$length;i++){

                if(i==0){

                    str +="<li class='on'>"+(i+1)+"</li>";
                }else{

                    str += "<li>"+(i+1)+"</li>";
                }
            }
            $box2.innerHTML = str;

                         var current = 0;

                         var timer;
            timer = setInterval(go,4000);
            function go(){

                for(var j =0;j<$length;j++){

                    $box1[j].style.display = "none";
                    $box2.children[j].className = "";
                }
                if($length == current){

                    current = 0;
                }
                $box1[current].style.display = "block";
                $box2.children[current].className = "on";
                current++;
            }

                         for(var k=0;k<$length;k++){

                $box1[k].onmouseover = function(){

                    clearInterval(timer);
                }
                $box1[k].onmouseout = function(){

                    timer = setInterval(go,4000);
                }
            }
            for(var p=0;p<$box3.children.length;p++){

                $box3.children[p].onmouseover = function(){

                    clearInterval(timer);
                };
                $box3.children[p].onmouseout = function(){

                    timer = setInterval(go,4000);
                }
            }

                         for(var u =0;u<$length;u++){

                $box2.children[u].index  = u;
                $box2.children[u].onmouseover = function(){

                    clearInterval(timer);
                    for(var j=0;j<$length;j++){

                        $box1[j].style.display = "none";
                        $box2.children[j].className = "";
                    }
                    this.className = "on";
                    $box1[this.index].style.display = "block";
                    current = this.index +1;
                }
                $box2.children[u].onmouseout = function(){

                    timer = setInterval(go,2000);
                }
            }

                         $box3.children[0].onclick = function(){

                back();
            }
            $box3.children[1].onclick = function(){

                go();
            }
            function back(){

                for(var j =0;j<$length;j++){

                    $box1[j].style.display = "none";
                    $box2.children[j].className = "";
                }
                if(current == 0){

                    current = $length;
                }
                $box1[current-1].style.display = "block";
                $box2.children[current-1].className = "on";
                current--;
            }
        }

...

五、总结

一个优秀的网页应具备以下几个特点:

1.简洁实用

尽量以最高效率的方式将用户所要想得到的信息传送给他就是最好的,要去掉所有的冗余的东西;

2.使用方便

要满足使用者的要求,网页适合使用,显示出其功能美;

3.整体性好

围绕一个统一的目标设计,强调整体的功能性; 

4.形象突出

尽量符合网页美的标准,能够使网站的形象得到最大限度的提升,追求雅俗共赏。页面用色协调,布局符合形式美的要求:布局有条理,充分利用美的形式,使网页富有可欣赏性,提高档次。

5.交互式强

发挥网络的优势,想方设法使每个使用者都参与到其中来。

更多优质博客文章、完整代码案例模板,点击以下链接查阅:

仙女网页设计-CSDN博客

Web前端网页制作、大学生期末大作业、课程设计、毕业设计、完整代码案例模板、Web前端网页定制、教学课程、学习资料等,有需要的添加以下微信交流

相关知识

HTML5期末大作业:动物宠物主题网站设计——宠物网(8页)HTML+CSS+JavaScript 学生DW网页设计作业成品 web课程设计网页规划与设计 web学生网页设计作业源码
宠物狗狗网站 网页设计 html源码 大作业
HTML5期末大作业:宠物主题网站设计——酷酷动物主题响应式网页(5页) HTML+CSS+JavaScript...
大学生网页设计制作作业实例代码 (全网最全,建议收藏) HTML+CSS+JS
HTML5期末大作业:宠物狗狗主题——好宠之家(5页) HTML+CSS+JavaScript 学生个人HTML代码 学生网页课程设计期末作业下载 web网页设计制作成品
389.大学生HTML5期末大作业 —【可爱的宠物猫主题网页(10页)】 Web前端网页制作 html5+css3+js
HTML5期末大作业:动物网站设计——宠物狗(10页) HTML+CSS+JavaScript 大学生静态网页设计 dw宠物网页设计 狗狗网页设计html web课程设计网页规划与设计
HTML5期末大作业:宠物网站设计——布偶猫(7页)带留言板 HTML+CSS+JavaScript web结课作业的源码 web网页设计实例作业 html大学生网站开发实践作业
HTML5期末大作业:宠物网站设计——布偶猫(7页)带留言板 HTML+CSS+JavaScript web结课作业的源码 web网页设计实例作业 html大学生网站开发实践作业...
【web前端期末大作业】HTML+CSS宠物狗静态网页设计

网址: 211. 大学生HTML5期末大作业 ―【 可爱的宠物狗主题网页(22页)】 Web前端网页制作 html5+css3+js https://m.mcbbbk.com/newsview946232.html

所属分类:萌宠日常
上一篇: 河蚌肉怎么清洗干净
下一篇: 各种宠物狗图片