鼠标悬浮上浮出现说明文本代码实例
分类:实例代码
分享一段代码实例,它实现了鼠标悬浮,出现说明文本的效果。
这样的功能在实际应用中十分常见,需要的朋友可以做一下参考。
代码实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.pipipi.net/" /> <title>前端教程网</title> <style> ul,li,i,div,h3,p,label{ margin: 0; padding: 0; } .ul1 li{ position:relative; width: 250px; height: 200px; list-style: none; overflow: hidden; box-shadow:0 5px 10px rgba(0, 0, 0, 0.0980392); color:#93999f; cursor: pointer; border-radius: 5px; } .ul1 i{ display:block; width: 250px; height: 150px; background: #bce8f1; } .ul1 div{ width: 250px; height: 144px; } .ul1 div .label1{ position: absolute; top:130px; background: white; transition: all 0.5s; } .ul1 li:hover{ box-shadow:0 5px 20px rgba(0, 0, 0, 0.298039); } .ul1 li:hover .label1{ top:100px; } .ul1 div h3{ font-size: 14px; margin-top: 33px; color: #444; } .ul1 div p{ height: 40px; font-size: 12px; } .ul1 .label2{ position: absolute; width: 250px; bottom: 0; height: 20px; background: white; } .color-red{ color: red; } .r{ float: right } </style> </head> <body> <ul class="ul1"> <li> <i></i> <div> <label class="label1"> <h3>前端教程网</h3> <p>本站的url地址是www.pipipi.net,欢迎大家的访问</p> </label> <label class="label2"> <span class="l color-red">¥88.00</span> <span class="r">888人在学</span> </label> </div> </li> </ul> </body> </html>
鼠标悬浮上浮出现说明文本代码实例,这样的场景在实际项目中还是用的比较多的,关于鼠标悬浮上浮出现说明文本代码实例就介绍到这了。
鼠标悬浮上浮出现说明文本代码实例属于前端实例代码,有关更多实例代码大家可以查看。