Corporate Tree Diagram - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Corporate Tree Diagram</title> <style> body { font-family: 'Arial', sans-serif; background: #ffffff; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .tree { display: flex; flex-direction: column; align-items: center; position: relative; } .tree ul { padding-top: 20px; position: relative; transition: all 0.5s; display: flex; justify-content: center; } .tree li { list-style-type: none; margin: 0 10px; text-align: center; position: relative; padding: 20px 5px 0 5px; } .tree li::before, .tree li::after { content: ''; position: absolute; top: 0; right: 50%; border-top: 2px solid #444; width: 50%; height: 20px; } .tree li::after { right: auto; left: 50%; border-left: 2px solid #444; } .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 #444; border-radius: 0 5px 0 0; } .tree li:first-child::after { border-radius: 5px 0 0 0; } .tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 2px solid #444; width: 0; height: 20px; } .tree li a { border: 2px solid #444; padding: 10px 20px; text-decoration: none; color: #333; font-family: 'Arial', sans-serif; font-size: 18px; display: inline-block; border-radius: 5px; transition: all 0.3s; position: relative; background: #f0f0f0; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); display: flex; align-items: center; justify-content: center; } .tree li a .icon { margin-right: 10px; font-size: 24px; } .tree li a:hover, .tree li a:focus { background: #e0e0e0; color: #000; border-color: #333; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); } .tree li a:hover .icon, .tree li a:focus .icon { animation: bounce 0.6s; } @keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } } .tree li a span { font-size: 16px; } .tree .tooltip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 5px 10px; border-radius: 3px; font-size: 14px; opacity: 0; visibility: hidden; transition: all 0.3s; white-space: nowrap; } .tree li a:hover .tooltip, .tree li a:focus .tooltip { opacity: 1; visibility: visible; bottom: 110%; } .tree li a::before { content: '🏢'; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 20px; } </style> </head> <body> <div class="tree"> <ul> <li> <a href="#"><span class="icon">📈</span><span>CEO</span> <div class="tooltip">CEO</div> </a> <ul> <li> <a href="#"><span class="icon">💼</span><span>Manager 1</span> <div class="tooltip">Manager 1</div> </a> <ul> <li> <a href="#"><span class="icon">👨💼</span><span>Employee 1</span> <div class="tooltip">Employee 1</div> </a> </li> <li> <a href="#"><span class="icon">👩💼</span><span>Employee 2</span> <div class="tooltip">Employee 2</div> </a> </li> </ul> </li> <li> <a href="#"><span class="icon">💼</span><span>Manager 2</span> <div class="tooltip">Manager 2</div> </a> <ul> <li> <a href="#"><span class="icon">👨💻</span><span>Employee 3</span> <div class="tooltip">Employee 3</div> </a> </li> <li> <a href="#"><span class="icon">👩💻</span><span>Employee 4</span> <div class="tooltip">Employee 4</div> </a> </li> </ul> </li> </ul> </li> </ul> </div> </body> </html>