HTML实例网页代码, 本实例适合于初学HTML的同学。该实例里面有设置了css的样式设置,有div的样式格局,这个实例比较全面,有助于同学的学习,本文将介绍如何通过从头开始设计个人网站并将其转换为代码的过程来实践设计。
⚽精彩专栏推荐👇🏻👇🏻👇🏻
❤ 【作者主页——🔥获取更多优质源码】
一、网页介绍📖
1 网页简介:此作品为学生个人主页网页设计题材,HTML+CSS 布局制作,web前端期末大作业,大学生网页设计作业源码,这是一个不错的网页制作,画面精明,代码为简单学生水平, 非常适合初学者学习使用。
2.网页编辑:网页作品代码简单,可使用任意HTML编辑软件(如:Dreamweaver、HBuilder、Vscode 、Sublime 、Webstorm、Text 、Notepad++ 等任意html编辑软件进行运行及修改编辑等操作)。
3.知识应用:技术方面主要应用了网页知识中的: Div+CSS、鼠标滑过特效、Table、导航栏效果、Banner、表单、二级三级页面等,视频、 音频元素 、Flash,同时设计了Logo(源文件)所需的知识点。
一、网页效果🌌
二、代码展示😈
1.HTML结构代码 🧱
代码如下(示例):以下仅展示部分代码供参考~
<!DOCTYPE html>
<html>
<head>
<!-- *{
margin: 0;
padding: 0;
list-style: none;
}
.s1{
margin: 50px auto;
width: 1226px;
height: 460px;
position: relative;
}
.t1 img{
width: 1226px;
height: 460px;
/*让图片以主父级盒子为基准,合并在一起*/
position: absolute;
top: 0;
}
.t2 li{
width: 20px;
height: 20px;
background-color:black;
color: white;
font-size: 14px;
text-align: center;
z-index: 10;
border-radius: 50%;
display: inline-block;
}
.t2 li:hover{
background-color:chocolate;
cursor: pointer;/*鼠标变小手*/
}
.t2{
position: absolute;
bottom:10px;
left: 0;
text-align: center;
width: 100%;
} -->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>小米商城官网</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="./css/style.css" />
<script src="./js/jquery-3.1.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function(){
//初始化,设置第一个出现的图片和触碰点
$(".t1 li").first().show();
$(".t2 li").first().addClass("active");
//鼠标悬停事件,排斥其他按钮
$(".t2 li").mouseover(function(){
//悬停时
clearInterval(t);
$(this).addClass("active").siblings("li").removeClass("active");
var index=$(this).index();//获取索引
i=index;
$(".t1 li").eq(index).fadeIn().siblings("li").fadeOut();//筛选淡入其余淡出
})
//定时自动 setInterval(所执行方法函数,毫秒)
//所设定时间为2000毫秒,即2秒一次
var i=0;
var t = setInterval(move,2000);
function move(){//一次定义函数多次使用
i++;
if(i==4){
i=0;//判断循环到四张图的时候回到第一图重新播放
}
$(".t2 li").eq(i).addClass("active").siblings("li").removeClass("active");
$(".t1 li").eq(i).fadeIn().siblings().fadeOut();//筛选淡入
}
function moveleft(){//一次定义函数多
#zui div span a{
text-decoration: none;
}
.jiange{
position: relative;
left: 170px;
bottom: 150px;
}
#zui div a{
text-decoration: none;
color: #000000;
}
#zui p a{
line-height: 50px;
text-decoration: none;
color: #000000;
opacity: 0.6;
}
#zui p{
position: relative;
left: 170px;
bottom: 150px;
display: block;
}
#zui p a:hover{
color: orange;
}
#zui div a:hover{
color: orange;
}
#zui{
position: relative;
left: 150px;
bottom: 400px;
}
</style>
<div id="zui">
<img src="img/timg.jpg"/>
<div class="jiange"><a href="#dingbuhome"> 小米商城 </a>|<a href=""> MIUI </a>|<a href=""> 米家 </a>|<a href=""> 米聊 </a>|<a href=""> 多看 </a>|<a href=""> 游戏 </a>|<a href=""> 路由器 </a>|<a href=""> 米粉卡 </a>|<a href=""> 政企服务 </a>|<a href=""> 小米天猫店 </a>|<a href=""> 隐私政策 </a>|<a href=""> 问题反馈 </a>|<a href=""> 廉政举报 </a>|<a href=""> Select Region </a></div>
<p>
<a href="">©<span>mi.com</span>京ICP证110507号</a>
<a href="">京ICP备10046444号</a> <a href="">京公网安备11010802020134号</a> <a href="">京网文[2017]1530-131号</a>
</p>
<p>
<a href="">(京)网械平台备字(2018)第00005号</a>
<a href="">互联网药品信息服务资格证(京)-非经营性-204-0090</a>
<a href="">营业执照</a>
<a href="">医疗器械公告</a>
</p>
</div>
</body>
</html>
2.CSS样式代码 🏠
<style>
*{
padding: 0;
margin: 0;
list-style: none;
}
.t1 img{
width: 1226px;
height: 460px;
}
.s1{
width: 1226px;
height: 460px;
margin: 50px auto;
position: relative;
bottom: 50px;
}
.s2{
position: absolute;
left: 0;
top: 0;
width: 234px;
height: 460px;
background: #000000;
z-index:10;
opacity: 0.8;
}
.s2 li{
width: 234px;
height: 46px;
text-align: center;
}
.s2 li:hover{
background-color: chocolate;
}
.s2-ul span{
display: inline-block;
position: relative;
top: 10px;
font-size: 16px;
}
.s2-ul a{
text-decoration: none;
color: white;
}
.t1 li{
position: absolute;
top: 0;
left: 0;
display: none;
}
.t2 li{
width: 20px;
height: 20px;
background: white;
font-size: 14px;
border-radius: 50%;
text-align: center;
display: inline-block;
cursor: pointer;
}
.t2 li.active{
background-color: chocolate;
}
.t2{
position: absolute;
bottom: 10px;
left:50%;
}
.s1 .anniu{
width: 30px;
height: 60px;
background: rgba(0, 0, 0, 0.3);
color: white;
font-size: 14px;
text-align: center;
line-height: 60px;
position: absolute;
top: 50%;
margin-top: -30px;
cursor: pointer;
}
.s1 .left{
left: 234px;
}
.s1 .right{
right: 0;
}
.dingbu-right{
display: inline-block;
float: right;
position: relative;
right: 300px;
}
.dingbu-right div{
padding: 20px;
}
.dingbu{
background: black;
line-height: 40px;
}
.dingbu a{
color: white;
text-decoration: none;
font-size: 13px;
opacity: 0.5;
padding:6px;
}
.dingbu a:hover{
opacity: 1;
}
.s3{
position: relative;
bottom: 80px;
left: 140px;
}
.s3-img-1{
position: relative;
right: 155px;
}
.s3-img-2{
position: relative;
right: 155px;
}
.s3-img-3{
position: relative;
right: 135px;
}
.s3-img-4{
position: relative;
right: 115px;
}
.s4-1{
width: 234px;
height: 340px;
background: white;
border-top: 2px solid red;
}
.s4-headfont{
font-size: 22px;
}
.s4{
position: relative;
left: 60px;
}
.list-1{
position: relative;
left: 200px;
}
.denglu-font{
position: relative;
left: 160px;
}
#img1{
position: absolute;
left: 230px;
}
.denglu-font2{
position: relative;
display: inline;
left: 450px;
}
.s4-123{
position: relative;
left: 100px;
}
</style>
三、个人总结😊
一套合格的网页应该包含(具体可根据个人要求而定)
- 页面分为页头、菜单导航栏(最好可下拉)、中间内容板块、页脚四大部分;
- 所有页面相互超链接,可到三级页面,有5-10个页面组成;
- 页面样式风格统一布局显示正常,不错乱,使用Div+Css技术;
- 菜单美观、醒目,二级菜单可正常弹出与跳转;
- 要有JS特效,如定时切换和手动切换图片新闻;
- 页面中有多媒体元素,如gif、视频、音乐,表单技术的使用;
- 页面清爽、美观、大方,不雷同。
- 网站前端程序不仅要能够把用户要求的内容呈现出来,还要满足布局良好、界面美观、配色优雅、表现形式多样等要求。
四、更多干货🚀
1.如果我的博客对你有帮助、如果你喜欢我的博客内容,请 “👍点赞” “✍️评论” “💙收藏”
一键三连哦!
2.❤️【关注我| 获取更多源码 | 优质文章】
带您学习各种前端插件、3D炫酷效果、图片展示、文字效果、以及整站模板 、大学生毕业HTML模板 、期末大作业模板 、等! 「在这里有好多 前端 开发者,一起探讨 前端 Node 知识,互相学习」!
3.