.Container {
padding: 0;
margin: 0;
}
.Container li {
list-style-type: none; /* убрать кружочки/точечки */
}
/* узел отодвинут от левой стенки контейнера на 18px
благодаря этим отступам вложенные узлы формируют иерархию
*/
.Node {
margin-left: 18px;
zoom: 1; /* спецсвойство против багов IE6,7. Ставит hasLayout */
}
/* Корневой узел от родительского контейнера не отодвинут.
Ему же не надо демонстрировать отступом, чей он сын.
Это правило идет после .Node, поэтому имеет более высокий приоритет
Так что class="Node IsRoot" дает margin-left:0
*/
.IsRoot {
margin-left: 0;
}
/* иконка скрытого/раскрытого поддерева или листа
сами иконки идут дальше, здесь общие свойства
*/
.Expand {
width: 18px;
height: 18px;
/* принцип двухколоночной верстки. */
/* float:left и width дива Expand + margin-left дива Content */
float: left;
}
/* содержание (заголовок) узла */
.Content {
/* чтобы не налезать на Expand */
margin-left:18px;
/* высота заголовка - как минимум равна Expand
Т.е правая колонка всегда выше или равна левой.
Иначе нижний float будет пытаться разместиться на получившейся ступеньке
*/
min-height: 18px;
}
/* все правила после * html выполняет только IE6 */
* html .Content {
height: 18px; /* аналог min-height для IE6 */
}
.Expand:after {
content: '';
border: 2px solid #cccccc;
display: block;
width: 14px;
height: 14px;
position: relative;
left: -4px;
top: 1px;
}
/* открытое поддерево */
.ExpandOpen .Expand {
/*background-image: url(/forum/img/minus.gif); */
}
.ExpandOpen:before {
content: '';
display: block;
width: 10px;
height: 2px;
background-color: #aaaaaa;
position: relative;
top: 12px;
}
/* закрытое поддерево */
.ExpandClosed .Expand {
/*background-image: url(/forum/img/plus.gif);*/
}
.ExpandClosed:before {
content: '';
display: block;
width:...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.