CSS3——过渡模块——手风琴案例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>CSS3过渡模块-手风琴效果</title> <style> *{margin: 0;padding: 0;} ul{ width: 960px; height: 300px; border: 1px solid red; margin: auto; list-style: none; overflow: hidden; } ul li{ width: 160px; float: left; transition: width 1s; } 鼠标悬浮ul时,设置所有li宽度变小 ul:hover li{ width: 100px; } ul li:hover{鼠标悬浮当前li时,宽度变宽 width: 460px; } </style> </head> <body> <ul> <li><img src="video/images/ad1.jpg" alt=""></li> <li><img src="video/images/ad2.jpg" alt=""></li> <li><img src="video/images/ad3.jpg" alt=""></li> <li><img src="video/images/ad4.jpg" alt=""></li> <li><img src="video/images/ad5.jpg" alt=""></li> <li><img src="video/images/ad6.jpg" alt=""></li> </ul> </body> </html>
鼠标悬浮时效果图:
相关推荐
Kindlecode 2013-07-18
yongqiling 2019-05-17
qiukui00 2017-01-10
CeiWCJ 2012-09-14
87407607 2012-08-22
软件设计 2017-07-06
软件设计 2017-05-17