正在起飞得菜鸟 2021-06-16 18:59 采纳率: 0%
浏览 45

鼠标悬浮图片 提示图片信息 不用title js如何写

  •  

 

 

  • 写回答

6条回答 默认 最新

  • 关注
    <!doctype html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8" />
    	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    	<title> 页面名称 </title>
    <style type="text/css">
    .fl {
    	float: left;
    	position: relative;
    	margin: 20px;
    }
    .fl > .inf {
    	position: absolute;
    	top: 100%;
    	left: 20px;
    	background-color: #ccc;
    	border: 1px solid #999;
    	display: none;
    }
    .fl:hover > .inf {
    	display: block;
    }
    </style>
    </head>
    <body>
    <p class="fl"><span class="inf">图片信息1</span><img src="1.jpg" width="120" height="124" border="0" alt=""></p>
    <p class="fl"><span class="inf">图片信息2</span><img src="2.jpg" width="120" height="124" border="0" alt=""></p>
    </body>
    </html>
    
    评论

报告相同问题?