爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
DIV+CSS实现的家族族谱树状代码分享
DIV+CSS实现的家族族谱树状代码分享
日期:2014-05-18 浏览次数:20236 次
以下是程序代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>家谱树状代码 demo by js.aiyiweb.com</title> <style class="csscreations"> /*Now the CSS*/ * {margin: 0; padding: 0;} .tree ul { padding-top: 20px; position: relative; transition: all 0.5s; -webkit-transition: all 0.5s; -moz-transition: all 0.5s; } .tree li { float: left; text-align: center; list-style-type: none; position: relative; padding: 20px 5px 0 5px; transition: all 0.5s; -webkit-transition: all 0.5s; -moz-transition: all 0.5s; } /*We will use ::before and ::after to draw the connectors*/ .tree li::before, .tree li::after{ content: ''; position: absolute; top: 0; right: 50%; border-top: 1px solid #ccc; width:50%; height: 20px; } .tree li::after{ right: auto; left: 50%; border-left: 1px solid #ccc; } /*We need to remove left-right connectors from elements without any siblings*/ .tree li:only-child::after, .tree li:only-child::before { display: none; } /*Remove space from the top of single children*/ .tree li:only-child{ padding-top: 0;} /*Remove left connector from first child and right connector from last child*/ .tree li:first-child::before, .tree li:last-child::after{ border: 0 none; } /*Adding back the vertical connector to the last nodes*/ .tree li:last-child::before{ border-right: 1px solid #ccc; border-radius: 0 5px 0 0; -webkit-border-radius: 0 5px 0 0; -moz-border-radius: 0 5px 0 0; } .tree li:first-child::after{ border-radius: 5px 0 0 0; -webkit-border-radius: 5px 0 0 0; -moz-border-radius: 5px 0 0 0; } /*Time to add downward connectors from parents*/ .tree ul ul::before{ content: ''; position: absolute; top: 0; left: 50%; border-left: 1px solid #ccc; width: 0; height: 20px; } .tree li a{ border: 1px solid #ccc; padding: 5px 10px; text-decoration: none; color: #666; font-family: arial, verdana, tahoma; font-size: 11px; display: inline-block; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; transition: all 0.5s; -webkit-transition: all 0.5s; -moz-transition: all 0.5s; } /*Time for some hover effects*/ /*We will apply the hover effect the the lineage of the element also*/ .tree li a:hover, .tree li a:hover+ul li a { background: #c8e4f8; color: #000; border: 1px solid #94a0b4; } /*Connector styles on hover*/ .tree li a:hover+ul li::after, .tree li a:hover+ul li::before, .tree li a:hover+ul::before, .tree li a:hover+ul ul::before{ border-color: #94a0b4; } /*Thats all. I hope you enjoyed it. Thanks :)*/ </style> </head> <body> <!-- We will create a family tree using just CSS(3) The markup will be simple nested lists --> <div class="tree"> <ul> <li> <a href="#">父亲</a> <ul> <li> <a href="#">孩子1</a> <ul> <li> <a href="#">孙子</a> </li> </ul> </li> <li> <a href="#">孩子2</a> <ul> <li><a href="#">孙子1</a></li> <li> <a href="#">孙子2</a> <ul> <li> <a href="#">曾孙1</a> </li> <li> <a href="#">曾孙2</a> </li> <li> <a href="#">曾孙3</a> </li> <li> <a href="#">曾孙4</a> </li> <li> <a href="#">曾孙5</a> </li> <li> &
上一篇:狡猾的按钮特效
下一篇:一款基础模型的JS打飞机游戏特效代码
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
中移动业绩增长趋缓 目光转向海外市场
Kindle入华遭遇国内厂商“围剿 ” 电信也参战
小米打响手机价格战 为米3铺路或另有所图
携程艺龙联手死磕同程 价钱烽烟蔓延至机票
从旗下三大业务BG发展看华为的过去现在和未来
小米年度发布会遭围剿!多款新品难阻品牌危机
打车软件“明补变暗补”背后的小算盘
孙正义入股阿里往事还原:阿里巴巴并非软银首选
微信收费形式三选一 腾讯或变身运营商
推荐阅读
更多>
国美痛批网购七宗罪 用短暂盈利输了未来
挂号网高管团体离任 或因投资人失掉决计
谷歌安卓全球副总裁为何跳槽中国企业小米?
都是300元内 乐视盒子与小米盒子对比体验
从3G牌照发放看中国4G规划效果
蜗牛移动董事长石海:号卡被叫停属乌龙事件
马云的SNS之梦有了新目标 收购“微博”
说说这一个月的赌球输了多少
迅雷向美SEC提交IPO招股书:拟最多筹资1亿美元
曹国伟:微博将关注Facebook和Twitter
总部大楼已换微软Logo:回忆诺基亚的兴衰史
创维冲击500亿梦想:转型硬件和内容供应商
盛大游戏走向衰落的根源:免费游戏模式惹的祸
刘强东向总理建言:打击有组织有规模的售假商家
广东移动董事长徐龙受调查 圈内对其褒贬不一
估值增长9.8% 阿里IPO前市值达2450亿美元
曝阿里巴巴一怀孕员工过劳死 加班情况引争议
FB上广告费用昂贵而且效果不及Twitter
人们为什么总愿尝试新社交网络?
HTC与苹果三星距离扩展 C2B形式成新武器