小编Gab*_*ira的帖子

我如何用css反转html族树布局?

我为我的项目选择了这个家族树布局,但是我需要它反转但在html中保持相同的顺序,只需更改css.它是同一棵树但倒置了.

这个例子准确地显示了我想要的方式:

例

.tree {
  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;
}

.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: …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
255
查看次数

标签 统计

css ×1

html ×1