网页中,当鼠标放在菜单上时会出现一个和网页宽度一样的下拉菜单,怎么写代码,求大神。

叫我小栗子 2017-11-30 04:49:47
网页中,当鼠标放在菜单上时会出现一个和网页宽度一样的下拉菜单,怎么写代码,求大神。
...全文
379 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
叫我小栗子 2017-11-30
  • 打赏
  • 举报
回复
引用 1 楼 天际的海浪的回复:

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<title> 页面名称 </title>
<style type="text/css">
.text {
	width: 60px;
	height: 30px;
	background-color: #3d3;
}
.text .mbox {
	position: absolute;
	left: 0;
	width: 100%;
	height: 500px;
	background-color: #9f9;
	display: none;
}
.text:hover .mbox {
	display: block;
}
</style>
</head>
<body>
<div class="text">
	菜单
	<div class="mbox"></div>
</div>
</body>
</html>
谢谢谢谢谢谢谢谢谢谢谢谢
天际的海浪 2017-11-30
  • 打赏
  • 举报
回复

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<title> 页面名称 </title>
<style type="text/css">
.text {
	width: 60px;
	height: 30px;
	background-color: #3d3;
}
.text .mbox {
	position: absolute;
	left: 0;
	width: 100%;
	height: 500px;
	background-color: #9f9;
	display: none;
}
.text:hover .mbox {
	display: block;
}
</style>
</head>
<body>
<div class="text">
	菜单
	<div class="mbox"></div>
</div>
</body>
</html>

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧