如何使用bootstrap创建水平节点分支?

时间:2016-11-24 07:31:35

标签: css twitter-bootstrap-3

如何在bootstrap中创建这样的东西?

enter image description here

我正在考虑使用网格布局为每个节点制作4列。但是中心节点占用的空间比应该占用的空间要多。

这是bootply http://www.bootply.com/5ni6EJeTWM

截至目前,它看起来像这样

enter image description here

1 个答案:

答案 0 :(得分:1)

这是我想出的。它并不完美但它应该可以帮助你走上正轨。

更新代码 - 现在完全响应!!!



.node-list {
  margin-bottom: 10px;
  overflow: hidden;
  width: 100%;
  padding: 0px;
  margin: 0px;
}

.node-list li {
  list-style-type: none;
  color: white;
  text-transform: uppercase;
  font-size: 14px;
  width: 25%;
  float: left;
  position: relative;
  text-align: center;
}

.node-list li p {
  color: #000;
  font-weight: bold;
}

.node-list li:after {
  content: '';
  width: 20px;
  height: 20px;
  line-height: 20px;
  display: block;
  font-size: 18px;
  color: #000;
  background: #fff;
  border: 10px solid #000;
  margin: 0 auto 5px auto;
}

.node-list li:before {
  content: '';
  width: 100%;
  height: 6px;
  background: #000;
  position: absolute;
  left: -50%;
  bottom: 20px;
  z-index: -1
}

.node-list li:first-child:before {
  content: none;
}

<ul class="node-list">
  <li class="active">
    <p>ABC</p>
  </li>
  <li class="">
    <p>ABC</p>
  </li>
  <li class="">
    <p>ABC</p>
  </li>
  <li class="">
    <p>ABC</p>
  </li>
</ul>
&#13;
&#13;
&#13;