爱易网
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 浏览次数:20191 次
以下是程序代码
<!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打飞机游戏特效代码
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
小米年度发布会遭围剿!多款新品难阻品牌危机
看,网络文学今日之繁盛;忆,纯真去哪了?
孙正义入股阿里往事还原:阿里巴巴并非软银首选
迅雷再次在美提交IPO申请
苹果6月20日发布iPhone5S 触摸屏概念股生动
云储存有多远:跨过数据安全问题即可到达
快播灭了,还有西瓜:视频网站的灰色江湖还在
国内首个大数据系列指数今日发布
微软谷歌高层访韩面前:忌惮三星的崛起
推荐阅读
更多>
国美在线叫板京东:李俊涛底气在哪?
代工厂生活危机:“富士康们”何去何从?
如家撤离同程内情:祸起反水OTA“联盟”?
解析2014年阿里百度等五大互联网巨头深度布局
雅安地震救灾前线的科技之手 微弱而暖和
英特尔VS苹果:移动芯片大战
支付宝曝平安破绽:转账信息被谷歌抓取
小米打响手机价格战 为米3铺路或另有所图
眼球识别技术EyeVerify融资600万美元 360参投
陈天桥之鉴:产品创新被扼杀那些事
韩国研制无线充电系统:一次可充40部手机
国美电商开打价钱战 牟贵先言行矛盾受质疑
苹果优势逐渐丧失 传即将推出廉价iPhone
微软不会被颠覆
传三星为赢得新兴市场:推廉价版Note3
迪信通神秘免费服务揭谜底:充电宝免费带回家
继续涨:微博IPO第二交易日 收盘大涨11.71%
欧洲6万人起诉Facebook隐私侵权
从百度世界大会看大数据
网曝富士康500万iphone遭退货是确证的事