简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8"> <link href="/static/next/css/tryit.css?v=2017082407" rel="stylesheet"/> <style> .dropdown { position: relative; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); } .dropdown:hover .dropdown-content { display: block; } .desc { padding: 15px; text-align: center; } </style> <h2>下拉图片</h2> <p>移动鼠标到图片上显示下拉内容。</p> <div class="dropdown"> <img src="http://www.twle.cn/wp-content/uploads/2015/09/banner.jpg" alt="Trolltunga Norway" width="100" height="50"> <div class="dropdown-content"> <img src="http://www.twle.cn/wp-content/uploads/2015/09/banner.jpg" alt="Trolltunga Norway" width="400" height="200"> <div class="desc">学的不仅是技术,更是梦想!</div> </div> </div> <footer>简单教程,简单编程<br/>Copyright © 简单教程 www.twle.cn</footer>
运行结果: