Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Tree or Sitemap using bootstrap 4 ( Winson222 )"
Bootstrap 4.1.1 Snippet by
mattcoad
4.1.1
Preview
HTML
CSS
JS
View Full Screen
Forked from
Fork
Fork this
Parent
1.2K
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css"> <!---- Must Add above thing or you can use alternative icons or CSS Entities----> <div class="tree "> <ul> <li><span><a style="color:#000; text-decoration:none;" data-toggle="collapse" href="#Web" aria-expanded="true" aria-controls="Web"><i class="collapsed"><i class="fas fa-folder"></i></i> <i class="expanded"><i class="far fa-folder-open"></i></i> Web</a></span> <div id="Web" class="collapse show"> <ul> <li><span><i class="far fa-file"></i><a href="#!"> Link 1</a></span></li> <li><span><a style="color:#000; text-decoration:none;" data-toggle="collapse" href="#page1" aria-expanded="false" aria-controls="page1"><i class="collapsed"><i class="fas fa-folder"></i></i> <i class="expanded"><i class="far fa-folder-open"></i></i> Page 1</a></span> <ul><div id="page1" class="collapse"> <li><span><i class="far fa-file"></i><a href="#!"> Link 1</a></span></li> <li><span><i class="far fa-file"></i><a href="#!"> Link 2</a></span></li> <li><span><i class="far fa-file"></i><a href="#!"> Link 3</a></span></li> <li><span><i class="far fa-file"></i><a href="#!"> Link 4</a></span></li></div> </ul> </li> <li><span><a style="color:#000; text-decoration:none;" data-toggle="collapse" href="#Page2" aria-expanded="false" aria-controls="Page2"><i class="collapsed"><i class="fas fa-folder"></i></i> <i class="expanded"><i class="far fa-folder-open"></i></i> Page 2</a></span> <ul><div id="Page2" class="collapse"> <li><span><a style="color:#000; text-decoration:none;" data-toggle="collapse" href="#folder1" aria-expanded="false" aria-controls="folder1"><i class="collapsed"><i class="fas fa-folder"></i></i> <i class="expanded"><i class="far fa-folder-open"></i></i> Folder 1</a></span> <ul><div id="folder1" class="collapse"> <li><span><i class="far fa-file"></i><a href="#!"> Link 1</a></span></li> <li><span><i class="far fa-file"></i><a href="#!"> Link 2</a></span></li> <li><span><i class="far fa-file"></i><a href="#!"> Link 3</a></span> <a href="#!">& More Link</a></li></div> </ul> </li> <li><span><a style="color:#000; text-decoration:none;" data-toggle="collapse" href="#folder2" aria-expanded="false" aria-controls="folder2"><i class="collapsed"><i class="fas fa-folder"></i></i> <i class="expanded"><i class="far fa-folder-open"></i></i> Folder 2</a></span> <ul><div id="folder2" class="collapse"> <li><span><i class="far fa-file"></i><a href="#!"> Link 1</a></span></li> <li><span><i class="far fa-file"></i><a href="#!"> Link 2</a></span></li> <li><span><i class="far fa-file"></i><a href="#!"> Link 3</a></span> <a href="#!">& More Link</a></li></div> </ul> </li> <li><span><a style="color:#000; text-decoration:none;" data-toggle="collapse" href="#folder3" aria-expanded="false" aria-controls="folder3"><i class="collapsed"><i class="fas fa-folder"></i></i> <i class="expanded"><i class="far fa-folder-open"></i></i> Folder 3</a></span> <ul><div id="folder3" class="collapse"> <li><span><i class="far fa-file"></i><a href="#!"> Link</a></span> <a href="#!">& More Link</a></li></div> </ul> </li> <li><span><i class="far fa-file"></i><a href="#!"> Link</a></span></li> </div> </ul> </li> <li><span><i class="far fa-file"></i><a href="#!"> Link 2</a></span></li> </ul> </div> </li> </ul> </div>
.tree li { list-style-type:none; margin:0; padding:10px 5px 0 5px; position:relative } .tree li::before, .tree li::after { content:''; left:-20px; position:absolute; right:auto } .tree li::before { border-left:2px solid #000; bottom:50px; height:100%; top:0; width:1px } .tree li::after { border-top:2px solid #000; height:20px; top:25px; width:25px } .tree li span { -moz-border-radius:5px; -webkit-border-radius:5px; border:2px solid #000; border-radius:3px; display:inline-block; padding:3px 8px; text-decoration:none; cursor:pointer; } .tree>ul>li::before, .tree>ul>li::after { border:0 } .tree li:last-child::before { height:27px } .tree li span:hover { background: hotpink; border:2px solid #94a0b4; } [aria-expanded="false"] > .expanded, [aria-expanded="true"] > .collapsed { display: none; }
/* Make it simple */ /* Pure css */ /* You can also use this for sitemap */ /* check this out=> https://bootsnipp.com/Winson222 */
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76