欢迎光临
我们一直在努力

家谱html源码,好看的族谱树状图效果代码

家谱树状代码 demo by www.webym.net

/*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 :)*/

运行代码 提示:您可以先修改部分代码再运行。

  • 海报
海报图正在生成中...
赞(0) 打赏
声明:
1、本博客不从事任何主机及服务器租赁业务,不参与任何交易,也绝非中介。博客内容仅记录博主个人感兴趣的服务器测评结果及一些服务器相关的优惠活动,信息均摘自网络或来自服务商主动提供;所以对本博客提及的内容不作直接、间接、法定、约定的保证,博客内容也不具备任何参考价值及引导作用,访问者需自行甄别。
2、访问本博客请务必遵守有关互联网的相关法律、规定与规则;不能利用本博客所提及的内容从事任何违法、违规操作;否则造成的一切后果由访问者自行承担。
3、未成年人及不能独立承担法律责任的个人及群体请勿访问本博客。
4、一旦您访问本博客,即表示您已经知晓并接受了以上声明通告。
文章名称:《家谱html源码,好看的族谱树状图效果代码》
文章链接:https://www.456zj.com/29364.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址