3.菜单栏
效果图如下:
代码图如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>下拉列表</title>
<style>
*{
margin: 0;
padding: 0;
}
ul{
list-style: none;
}
.biaoti{
width: 1000px;
margin: 0 auto;
}
.biaoti .biaoti1{
background-color: rgb(53, 62, 55);
color: aqua;
float: left;
line-height: 40px;
width: 120px;
text-align: center;
}
.biaoti .biaoti1:hover{
background-color: red;
}
.biaoti .biaoti1 ul{
display: none;
background-color: #ADFF2F;
}
.biaoti .biaoti1:hover ul{
display: block;
}
.biaoti .biaoti1 ul li:hover{
background-color: aquamarine;
}
.biaoti .biaoti1 .biaoti2{
background-color: rgb(53, 62, 55);
color: aqua;
float: left;
line-height: 40px;
width: 120px;
text-align: center;
}
.biaoti .biaoti1 .biaoti2:hover{
background-color: rgb(182, 226, 107);
}
.biaoti .biaoti1 .biaoti2 ul{
display: none;
background-color: #ba3c51;
}
.biaoti .biaoti1 .biaoti2:hover ul{
display: block;
}
.biaoti .biaoti1 .biaoti2 ul li:hover{
background-color: rgb(180, 127, 255);
}
</style>
</head>
<body>
<div>
<ul class="biaoti">
<li class="biaoti1">首页</li>
<li class="biaoti1">产品展示
<ul>
<li>产品一</li>
<li>产品二</li>
<li>产品三</li>
<li class="biaoti2">产品四
<ul>
<li>2302</li>
<li>2308</li>
<li>2309</li>
</ul>
</li>
</ul>
</li>
<li class="biaoti1">新闻资讯
<ul>
<li>产品一</li>
<li>产品二</li>
<li>产品三</li>
</ul>
</li>
<li class="biaoti1">客户服务
<ul>
<li>产品一</li>
<li>产品二</li>
<li>产品三</li>
</ul>
</li>
<li class="biaoti1">企业相册
<ul>
<li>产品一</li>
<li>产品二</li>
<li>产品三</li>
</ul>
</li>
<li class="biaoti1">关于我们
<ul>
<li>产品一</li>
<li>产品二</li>
<li>产品三</li>
</ul>
</li>
<li class="biaoti1">联系我们
<ul>
<li>产品一</li>
<li>产品二</li>
<li>产品三</li>
</ul>
</li>
</ul>
</div>
</body>
</html>
4.菜单栏
效果图如下:
代码部分如下:
<style>
*{
margin: 0;
padding: 0;
}
.box{
width: 1120px;
height: 500px;
/* border: 1px solid red; */
margin: 0 auto;
}
.box1{
width: 1060px;
height: 50px;
border-bottom: 3px solid rgb(175, 120, 120);
margin-left: 57px;
}
.box2{
color: blue;
float: left;
margin-left: 1px;
}
.box3{
float: left;
margin-top: 10px;
margin-left: 57px;
}
.box4{
width: 935px;
height: 50px;
}
.box4 li{
width: 50px;
height: 30px;
color: antiquewhite;
list-style: none;
float: left;
margin-left: 50px;
font-size: 14px;
line-height: 30px;
text-align: center;
}
.box4 a{
color: darkgrey;
text-decoration: none;
}
.box5 a{
float: right;
font-size: 14px;
color: grey;
margin-top: -30px;
text-decoration: none;
}
.box6{
margin-left: 50px;
}
.box6 img{
margin-left: 7px;
}
</style>
<body>
<div class="box">
<div class="box1">
<h1 class="box2">骆驼书</h1>
<span class="box3">读骆驼书,行万里路。</span>
</div>
<div class="box4">
<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>
</div>
<div class="box5">
<a href="#">更多></a>
</div>
<div class="box6">
<img src="../../C4D素材文件/001图片.png" alt="">
<img src="../../C4D素材文件/002图片.png" alt="">
<img src="../../C4D素材文件/003图片.png" alt="">
<img src="../../C4D素材文件/004图片.png" alt="">
</div>
</div>
</body>
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » 第二十七章HTML.CSS综合案例(二)
发表评论 取消回复