Web前端第二次作业

作业要求:制作带有下拉悬停菜单的导航栏

html 复制代码
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			body{
				height: 1000px;
			}
			*{
				margin: 0;
				padding: 0;
			}
			#menu{
				background-color: #0c2374;
				width: 100%;
				height: 50px;
			}
			#container{
				background-color: #0c2374;
				width: 100%;
				height: 50px;
				
			}
			.item{
				/* 浮动属性可以让块标签,处在同一行 */
				float: left;
				width: 100px;
				height: 50px;
				line-height: 50px;
				text-align: center;
				position: relative;
				color: white;
			}
			.item:hover{
				background-color: steelblue;
			}
			#container{
				width: 800px;
				margin: auto;
			}
			.down_meun>div{
				color: white;
				
			}
			.down_meun{
				background-color: steelblue;
				display: none;
				position: absolute;
				
			}
			.item:hover>.down_meun{
				display: block;
				width: 100px;
			}
			
			#ding{
				width: 90px;
				height: 50px;
				border: 2px solid #0c2374;
				text-align: center;
				line-height: 50px;
				position: fixed;
				right: 0px;
				bottom: 0px;
				color: steelblue;
				
				
				border-radius: 30px;
				font-size: 1.25rem;
				line-height: 50px;
				text-align: center;
				color: #64c09B;
				font-weight: bolder;
			}
			#ding:hover{
				background-color: #64c09B;
				color: aliceblue;
				text-shadow: 7px 4px 2px seagreen;
				box-shadow: 5px 5px 1px green;
				transition: 2s;
			}
			
		</style>
	</head>
	<body>
			<div id="menu">
				<div id="container">
					<div class="item">游戏1
						<div class="down_meun">
							<div>游戏下载</div>
							<div>游戏交易</div>
							<div>游戏外挂</div>
							<div>游戏攻略</div>	
						</div>
						
					</div>
					<div class="item">游戏2
						<div class="down_meun">
							<div>游戏mod1</div>
							<div>游戏mod2</div>
							<div>游戏mod3</div>
							<div>游戏mod4</div>
							
						</div>
					</div>
					
					<div class="item">游戏3</div>
					<div class="item">游戏4
						<div class="down_meun">
							<div>商学院</div>
							<div>土木与工程</div>
							<div>艺术与传媒</div>
							<div>信息工程学院</div>
							<div>文理学院</div>
							<div>大数据与人工智能</div>
							<div>马克思主义</div>
							
							
						</div>
					</div>
					<div class="item">游戏5</div>
					<div class="item">游戏6</div>
					<div class="item">游戏7</div>
					<div class="item">游戏8</div>
				</div>
			<div id="ding">
				<a href="#menu" >
					回到顶部
				</a>
			</div>
			
		</body>
	</html>

页面结果:

相关推荐
倾颜23 分钟前
从 textarea 到 AI 输入框:用 Tiptap 实现 / 命令、@ 引用和结构化请求
前端·langchain·next.js
kyriewen2 小时前
程序员连夜带团队跑路,省了23万:这AI太贵,真的用不起了
前端·javascript·openai
kyriewen2 小时前
你写的代码没有测试,就像出门不锁门——Jest + Testing Library 从入门到不慌
前端·单元测试·jest
yuzhiboyouye3 小时前
web前端英语面试
前端·面试·状态模式
canonical_entropy4 小时前
下一代低代码渲染框架 nop-chaos-flux 的设计原则
前端·低代码·前端框架
东方小月4 小时前
5分钟搞懂Harness Engineering(驾驭工程):从提示词到AI Agent的进化之路
前端·后端·架构
我叫黑大帅4 小时前
为什么需要 @types/react?解决“无法找到模块 react 的声明文件”报错
前端·javascript·面试
之歆5 小时前
DAY_21JavaScript 深度解析:数组(Array)与函数(Function)(一)
前端·javascript
XinZong5 小时前
【AI社交】基于OpenClaw自研轻量化AI社交平台实战
前端
Le_ee6 小时前
ctfweb:php/php短标签/.haccess+图片马/XXE
开发语言·前端·php