
首先,我们来看一下效果:

这个效果实现原理很简单:只要你掌握css3动画和过渡相关知识就行,不用js代码;
(推荐教程:CSS入门教程)
HTML代码:
立即学习“前端免费学习笔记(深入)”;
CSS代码:
*{ margin:0;padding:0; } ul{ list-style:none; } a{ font-size:16px;text-decoration:none;color:#666; } div{ width:300px;margin:20px auto; } #list li{ line-height:40px;height:40px;background:#efefef;text-indent:1em; margin-bottom:3px;overflow:hidden;-webkit-transition:height 0.3s ease;-moz-transition:height 0.3s ease-ms-transition:height 0.3s ease;-o-transition:height 0.3s ease;transition:height 0.3s ease;} #list li img{ width:300px;height:200px;} #list li:nth-child(1){height:240px;background:#F36;} #list li:nth-child(1) a{ color:#fff; } #list:hover li{ height:40px;background:#efefef; } #list:hover li a{color:#666;} #list li:hover{ height:240px; background:#F36;} #list li:hover a{ color:#fff; }
更多编程相关内容,请关注创想鸟编程入门栏目!
以上就是css如何实现图片抽屉式效果的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1614872.html
微信扫一扫
支付宝扫一扫