Modern Tabs - 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>Modern Tabs</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <style> body { margin: 0; font-family: Arial, sans-serif; background: linear-gradient(to right, #ff7e5f, #feb47b); height: 100vh; display: flex; justify-content: center; align-items: center; } .tabs-container { width: 80%; max-width: 700px; background: rgba(255, 255, 255, 0.8); border-radius: 20px; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); } .tabs-header { display: flex; border-bottom: 3px solid rgba(255, 255, 255, 0.4); } .tab-button { flex: 1; padding: 20px; text-align: center; border: none; background: rgba(255, 255, 255, 0.6); color: #333; cursor: pointer; transition: background 0.4s, color 0.4s, border-bottom 0.4s; font-size: 18px; } .tab-button:hover, .tab-button.active { background: rgba(255, 255, 255, 0.8); color: #ff7e5f; border-bottom: 3px solid #ff7e5f; } .tab-content { padding: 25px; display: none; animation: fadeIn 0.6s ease; } .tab-content.active { display: block; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } </style> </head> <body> <div class="tabs-container"> <div class="tabs-header"> <button class="tab-button active" data-tab="tab1"><i class="fas fa-star"></i> Highlights</button> <button class="tab-button" data-tab="tab2"><i class="fas fa-cogs"></i> Settings</button> <button class="tab-button" data-tab="tab3"><i class="fas fa-users"></i> Team</button> </div> <div class="tab-content active" id="tab1"> <p>Highlights of the Modern Tabs design.</p> </div> <div class="tab-content" id="tab2"> <p>Settings for the Modern Tabs design.</p> </div> <div class="tab-content" id="tab3"> <p>Team members involved in the Modern Tabs project.</p> </div> </div> <script> document.querySelectorAll('.tab-button').forEach(button => { button.addEventListener('click', () => { document.querySelectorAll('.tab-button').forEach(btn => btn.classList.remove('active')); document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active')); button.classList.add('active'); const tabId = button.getAttribute('data-tab'); document.getElementById(tabId).classList.add('active'); }); }); </script> </body> </html>