爱易网
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 浏览次数:20147 次
以下是程序代码
<!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打飞机游戏特效代码
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
美图手机2问世 三大问题令其市场销量堪忧
HTC的三大迷惘:高管釜底抽薪 产品营销战略混乱
华为坚持不上市究竟为何?不差钱也不想冒风险
新浪微博推粉丝头条功能 意欲与大号分成
英特尔VS苹果:移动芯片大战
中移动本月推手机钱包 iPhone遭边缘化
美国政府关门可能影响去哪儿等公司IPO
腾讯为何在与阿里百度的收购比赛中当看客?
携程艺龙联手死磕同程 价钱烽烟蔓延至机票
推荐阅读
更多>
马云的SNS之梦有了新目标 收购“微博”
马云寄厚望于物流 “菜鸟”行情暂难持续
从WPS到office365,中国企业能否赶超美国?
央行暂停二维码支付及虚拟信用卡 支付宝微信不知情
喜大普奔:2016年国内乘客有望在飞机上使用手机
传运营商高层将变化 专家称需体制革新
阿里巴巴450亿勾画“现代服务业”藏宝图
170号码扎堆上市:手机话费私人定制时代到来?
继续涨:微博IPO第二交易日 收盘大涨11.71%
去看看外面的世界吧!别窝里斗了,中国在线旅游商们
墨迹天气:产品创新以攻为守方能对抗巨头
任正非:华为决不上市 上市公司股东贪婪而短视
神州电脑中止IPO面前:再被质疑财务造假
“世界杯+618”集体磨刀的本质是绑架全民
搜狐与奇虎360或结盟对抗BAT
CSS控制字符长度和显示长度
湘鄂情剥离餐饮业务进军大数据的底气在哪里?
联想国庆完成收购IBM x86服务器
评论:阿里为什么不试着收购一家香港媒体呢
新浪微博推粉丝头条功能 意欲与大号分成