爱易网
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 浏览次数:20231 次
以下是程序代码
<!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打飞机游戏特效代码
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
易信工具性优势突出 丁磊三板斧或先砍在飞信上
腾讯为何在与阿里百度的收购比赛中当看客?
传苹果已告知鸿海:两款新iPhone下月发货
神州泰岳雪上加霜:副总违规买卖遭罚
谷歌欲收买WhatsApp添加砝码 对方否认
摩托罗拉中国区将再裁员 助力公司变身
众贷网满月开张 网络金融监管再受质疑
中国手游总裁及8名高管集体下岗,被指涉不当交易
联想国庆完成收购IBM x86服务器
推荐阅读
更多>
工商下月将整治手机市场
传360周鸿祎曾试图阻止百度收购91无线
iPhone 6 Plus要召回是谣言
余额宝收益率跌破5% 银行系宝宝收益率赶超
中国大陆人口13.7亿 光棍越来越多
做大电影,阿里控股公司在港成立影业集团
三大运营商合建铁塔公司真相:未涉及电信业重组
诺基亚依托规模效应 猛攻国际市场空白
逆转猜想:如果阿里成为雅虎大股东会怎样?
中移动推动感地带3G网聊卡 火拼微信沃卡
170号码扎堆上市:手机话费私人定制时代到来?
微软很“捉急”:补贴Win8 重加末尾按钮
苹果优势逐渐丧失 传即将推出廉价iPhone
王建宙解构OTT效劳 中移动重塑飞信平台
清点:罗永浩推锤子ROM 小米打法遭模拟
解析2014年阿里百度等五大互联网巨头深度布局
虚拟运营商前路迷茫 业界建议发力车联网
湖南卫视扶持芒果TV杀入媒体:版权独播不分销
迅雷向美SEC提交IPO招股书:拟最多筹资1亿美元
App Store严禁推送广告 运用面临大清洗