JS-absulote-display-相对定位-弹出效果

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
	<style>
		#d1{
			width:100px;
			height:30px;
			background:red;
			text-align:center;
			line-height:30px;
			color:#fff;
			float:right;
			/*相对定位:配合#menu做绝对定位*/
			position:relative;
		}

		#menu{
			width:300px;
			height:150px;
			background:red;
			/*绝对定位*/
			position:absolute;
			right:0px;
			top:30px;
			display:none;/*隐藏*/
		}

		#d1:hover #menu{
			display:block;/*显示*/
		}
	</style>
 </head>
 <body>
  <div id="d1">
		果园公告
		<div id="menu">
			果园公告弹出菜单
		</div>
	</div>
 </body>
</html>

posted @ 2018-11-11 19:36  IndustriousHe  阅读(391)  评论(0编辑  收藏  举报