Minimalist black text on white background showing a nested folder structure drawn with ASCII pipe characters

Pure CSS ASCII File Tree

This Pure CSS ASCII File Tree brings the nostalgia of command-line directory structures to the web without typing a single pipe character manually. By cleverly utilizing CSS pseudo-elements (::before), it automatically draws the connecting lines (, , ) for nested lists. It’s perfect for technical documentation, sitemaps, or retro-themed interfaces.

Technologies:
HTML CSS
Difficulty: Beginner
Browser Support (as of Jan 2026):
Chrome Chrome 4+ Edge Edge 12+ Firefox Firefox 3.5+ Safari Safari 3.1+
Features:
No Images ASCII Art Automatic Nesting Pseudo-Elements
Code by: Heydon Heydon
License: MIT

See the Pen Pure CSS ASCII File Tree.

A file tree diagram created with pure CSS, showing nested lists with connecting lines.

OST Tree

A pure CSS tree diagram constructed from nested lists where pseudo-elements with borders form the connecting branches.

See the Pen OST Tree.

List Styles

List Styles

An aesthetically pleasing, modern todo list featuring a vibrant gradient theme and an intuitive hierarchy creation function without complex control buttons.

See the Pen List Styles.

Pure CSS Tree

Tree structure in pure CSS. Interaction is handled via checkboxes and sibling selectors. Nesting visibility logic relies on controlling block height without JavaScript involvement.

Tree Diagram

Tree-based data structure rendered in pure CSS using checkboxes and sibling selectors. Nesting levels are controlled via element states, eliminating the need for JavaScript. Visual coherence is maintained through pseudo-elements simulating directional guides.

CSS3 Tree View Sticky

Hierarchical tree structure in pure CSS. Visual connectors are rendered using pseudo-element borders, while sticky headers are implemented via the sticky property. The layout logic relies on standard nested ul/li lists.

HTML5 Details & Summary File Tree

File tree structure implemented in pure HTML5/CSS3. Interaction logic relies solely on the <details> element, eliminating the need for JavaScript. Visual hierarchy and element connectivity are maintained through CSS selectors and dotted borders.

Tree View from Unordered List

Hierarchical tree diagram rendered in pure CSS. Visual node connectivity is achieved via display: table layout combined with pseudo-elements that form the connector lines. The structure is fully responsive and supports infinite nesting without scripting.

TreeView Details/Summary

Interactive tree-based navigation utilizing semantic <details> and <summary> elements. Expand/collapse behavior is handled natively by the browser, requiring zero JavaScript. Visual hierarchy is reinforced through custom CSS icons and pseudo-elements drawing structural connectors.

CSS3 Flowchart

An elegant and clear hierarchical structure that automatically adapts to the number of elements and levels of nesting.