Как сверстать такую схему?
Ответы (1 шт):
Автор решения: vantal
→ Ссылка
.tree {
position: relative;
overflow: hidden;
padding: 0 0 20px 0;
}
.tree ul {
position: relative;
padding: 20px 0;
transition: all 0.5s;
}
.tree li {
list-style-type: none;
float: left;
position: relative;
padding: 20px 5px 0 5px;
text-align: center;
transition: all 0.5s;
}
.tree li::before,
.tree li::after {
content: '';
position: absolute;
top: -2px;
right: 50%;
width: 50%;
height: 20px;
border-top: 2px solid #628bb1;
}
.tree li::after {
right: auto;
left: 50%;
border-left: 2px solid #628bb1;
}
.tree li:only-child::after,
.tree li:only-child::before {
display: none;
}
.tree li:only-child {
padding-top: 0;
}
.tree li:first-child::before,
.tree li:last-child::after {
border: 0 none;
}
.tree li:last-child::before {
border-right: 2px solid #628bb1;
border-radius: 0 2px 0 0;
}
.tree li:first-child::after {
border-radius: 2px 0 0 0;
}
.tree ul ul::before {
content: '';
position: absolute;
top: -2px;
left: 50%;
width: 0;
height: 20px;
border-left: 2px solid #628bb1;
}
.tree li a {
padding: 8px 10px;
border-radius: 4px;
text-decoration: none;
color: #fff;
font-size: 20px;
transition: all 0.5s;
background: linear-gradient(to top, #5197d8, #a8ccff);
width: 80px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
}
<div class="tree">
<ul>
<li>
<a href="#">JIRA</a>
<ul>
<li>
<a href="#">Group</a>
<ul>
<li>
<a href="#">User1</a>
</li>
<li>
<a href="#">User2</a>
</li>
</ul>
</li>
<li>
<a href="#">Project Role</a>
<ul>
<li>
<a href="#">User3</a>
</li>
<li>
<a href="#">User4</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
