通过HTML+CSS实现折叠样式完整代码

这篇文章主要介绍了通过HTML+CSS实现折叠样式完整代码,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

前言

通过html+css实现折叠样式

一、实现思路

动态修改元素的高度,并添加过渡效果。

二、实现代码

html代码:

 
选项一
选项11
选项22
选项33
选项44

css代码

 .fold{ width: 200px; height: 51px; transition: all 1s; overflow: hidden; text-align: center; line-height: 50px; background-color: transparent; color: white; border-radius: 5px; } .fold:hover{ height: 258px; } .child0{ width: 200px; height: 50px; background-color: #409eff; border-radius: 5px; } .child1{ width: 200px; height: 50px; border-top: 1px solid white; border-radius: 5px; background-color: #409eff; }

三、效果

到此这篇关于通过HTML+CSS实现折叠样式完整代码的文章就介绍到这了,更多相关css折叠样式内容请搜索0133技术站以前的文章或继续浏览下面的相关文章,希望大家以后多多支持0133技术站!

以上就是通过HTML+CSS实现折叠样式完整代码的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » CSS 教程