爱易网
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 浏览次数:20228 次
以下是程序代码
<!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打飞机游戏特效代码
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
墨迹天气:产品创新以攻为守方能对抗巨头
空气污染器市场乱象丛生 选购需慎重
OPPO Find7体验测 Find7综测
谷歌安卓全球副总裁为何跳槽中国企业小米?
阿里巴巴IPO难掩的四个现实问题:天猫销售额成谜、淘宝拖后腿、营收迅猛其他不行和投资者未必买账
微软不会被颠覆
频繁自杀 折射媒体变革中的媒体人迷茫与压力并存
苹果售后生态链乱象:供需失衡价钱不一
支付宝全面封杀比特币:充值码淘宝店或遭封禁
推荐阅读
更多>
小米盗版有理激怒乐视:提500部盗播证据猛追打
纸媒深探版权蓝海抗衡互联网的时机到来了
中国联通困局:遭遇OTT宽带4G三大难题
App Store严禁推送广告 运用面临大清洗
英特尔涉嫌垄断 欧盟或开出史上最高罚单
锐迪科将以9.25美元/ADS价钱出售835万份ADS
诺基亚因充电器问题暂停销售Lumia 2520平板电脑
公信力消失:马航事件社交媒体传播之痛
京东进驻微信一级入口或影响自身战略布局
PC迎9年来出货量新低 平板电脑渐成主流
工商下月将整治手机市场
中移动将推出多项4G资费新政
华为美国推出电商网站 发售Mate 2LTE版
200美元英特尔Android笔记本行将到来
三大运营商获通知大减营销费 传3年减400多亿
阿里物流搭上邮政:京东,我们在终点等你!
历史惊人相似:如今的库克 曾经的鲍尔默
曝阿里巴巴一怀孕员工过劳死 加班情况引争议
银联布局二维码支付,“擦边球”生态不能自救
苹果CEO抱歉解读:是战略而非“屈服”