目录
欢迎来到我的CSDN主页!Web前端网页制作、大学生期末大作业、课程设计、毕业设计、网页模版源码、学习资料等,更多优质博客文章、网页模板点击以下链接查阅:
5000+完整代码,主题涵盖30+种类型:
一、网页概述
本实例应用html+css+js: Div、导航栏、选项卡、图片轮翻效果、鼠标滑动特效等。适用于大学生网页课程作业设计、公司网页制作等,供大家参考。支持如Dreamweaver、HBuilder、Text 、Vscode 等任意html编辑软件进行编辑修改;支持包括IE、Firefox、Chrome、Safari主流浏览器浏览。
二、网页文件
本网页实例共包含6个页面:
三、网页效果
以下是本篇文章正文内容,下面案例仅供参考(节选示例):
四、代码展示
1.html
html>
<head>
<meta charset="utf-8" />
<!-- 优先使用 IE 最新版本和 Chrome -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- 为移动设备添加 viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<!--忽略页面中的数字识别为电话,忽略email识别-->
<meta name="format-detection" content="telphone=no, email=no" />
<title>首页</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/base.css" />
<!--[if lt IE 9]>
<script type="text/javascript" src="js/html5shiv.min.js"></script>
<script type="text/javascript" src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!--导航-->
<nav class="navbar navbar-default navbar-fixed-top top-box">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><img src="picture/logo.png" class="img-responsive" /></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right top-nav">
<li class="active">
<a href="index.html">
首页
<span class="sr-only">(current)</span>
</a>
</li>
<li>
<a href="about.html">关于肉萌萌</a>
</li>
<li>
<a href="news.html">公司新闻</a>
</li>
<li>
<a href="customer.html">客服中心</a>
</li>
<li>
<a href="zhaoshang.html">招商加盟</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!--/ 导航-->
<!--轮播图-->
<div id="carousel-example-generic" class="carousel slide banner" data-ride="carousel">
<!-- 圆点 -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- 图片区域 -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="picture/index-bn1.jpg" alt="">
</div>
<div class="item">
<img src="picture/index-bn2.jpg" alt="">
</div>
<div class="item">
<img src="picture/index-bn3.jpg" alt="">
</div>
</div>
...
2.CSS
代码如下(节选示例):
@charset "utf-8";
html,
body {
font-family: "novecento_widenormal", "STHeiti", "Microsoft JhengHei", "Microsoft YaHei", tahoma;
}
body {
padding-top: 50px;
}
/*顶部导航*/
.top-box {
height: 50px;
margin-bottom: 0;
z-index: 16;
}
.top-box .navbar-collapse {
border: none;
}
.top-box .navbar-brand {
height: 50px;
padding: 10px;
}
.top-box .navbar-brand img {
height: 100%;
}
.top-box .navbar-toggle {
margin-top: 8px;
}
.top-box .navbar-nav {
margin-top: 0 !important;
}
.top-nav li a {
line-height: 30px;
font-size: 14px;
text-align: center;
background: #fff !important;
}
.top-nav li.active a,
.top-nav li a:hover {
color: #f00 !important;
}
.common-title {
text-align: center;
}
.common-title h2 {
font-size: 20px;
margin-top: 0;
margin-bottom: 10px;
}
.common-title span {
display: block;
font-size: 18px;
color: #b2b2b2;
margin-bottom: 15px;
}
.common-title p {
text-align: center;
font-size: 0;
margin-bottom: 0;
}
.common-title p i {
display: inline-block;
width: 50px;
height: 1px;
margin: 0 2px;
background: #a4a4a4;
}
.common-title p i:first-child {
background: #009944;
}
/*页脚*/
.footer {
background: #eeeeee;
border-top: 10px solid #598c55;
padding-top: 30px;
padding-bottom: 30px;
}
.footer .thumbnail {
background: #eeeeee;
border: none;
text-align: center;
font-size: 12px;
margin-bottom: 0;
}
.bread {
font-size: 0;
background: #fff;
border-bottom: 2px solid #598c55;
border-radius: 0;
margin-bottom: 30px;
margin-top: 30px;
padding:10px 0;
}
.bread li,.bread li a{
font-size: 14px;
color: #808080;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bread li:last-child{
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bread .active{
color: #598c55;
}
/*首页--新闻中心*/
.news {
padding-top: 40px;
padding-bottom: 40px;
}
.news .news-content {
margin-top: 40px;
}
.news .news-content p {
margin-bottom: 0;
}
.news .thumbnail {
overflow: hidden;
padding: 0;
}
.news .thumbnail img {
width: 100%;
}
.news .news-content .caption {
padding: 0px 9px 20px 9px;
border-bottom: 1px solid #ccc;
color: #333;
}
.news .news-content .caption h3 {
margin-bottom: 12px;
font-size: 18px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.news .news-content .caption p {
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.news .news-des {
padding: 20px 9px 20px 9px;
color: #b2b2b2;
}
.news .news-des p {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
...
3.JS
代码如下(节选示例):
/*!
* Bootstrap v3.3.0 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.0",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document)
...
五、总结
一个优秀的网页应具备以下几个特点:
1.简洁实用
尽量以最高效率的方式将用户所要想得到的信息传送给他就是最好的,要去掉所有的冗余的东西;
2.使用方便
要满足使用者的要求,网页适合使用,显示出其功能美;
3.整体性好
围绕一个统一的目标设计,强调整体的功能性;
4.形象突出
尽量符合网页美的标准,能够使网站的形象得到最大限度的提升,追求雅俗共赏。页面用色协调,布局符合形式美的要求:布局有条理,充分利用美的形式,使网页富有可欣赏性,提高档次。
5.交互式强
发挥网络的优势,想方设法使每个使用者都参与到其中来。
更多优质博客文章、完整代码案例模板,点击以下链接查阅:
Web前端网页制作、大学生期末大作业、课程设计、毕业设计、完整代码案例模板、Web前端网页定制、教学课程、学习资料等,有需要的添加以下微信交流
标签:Web,网页,bottom,top,Bootstrap,news,overflow,margin From: https://blog.csdn.net/m0_67368443/article/details/144707699