Consistent Styling for Nested Lists with Bootstrap

前端 未结 5 1362
陌清茗
陌清茗 2020-12-22 18:39

Is there a way to make nested lists in twitter bootstrap look like a normal list, with the nested items simply indented (and have it work for an arbitrarily deep nesting)? B

5条回答
  •  执念已碎
    2020-12-22 19:16

    I modified Marcos answer to work with Bootstrap 4 (and fort-awesome icons) since glyphicons are no longer part of Bootstrap. The main changes are:

    • replace glyphicons by fort-awesome icons
    • add class list-group-item-action to list-group-item
    • redefine .collapse in css (maybe there is a better approach)

    .collapse {
        display: none;
        &.show {
            display: block;
        }
    }
    

    JSFiddle

提交回复
热议问题