Professional Styled 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>Professional Styled Tabs</title> <style> body { font-family: 'Arial', sans-serif; background-color: #f0f2f5; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; } .tabs-container { background: white; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); border-radius: 12px; overflow: hidden; width: 80%; max-width: 800px; } .tab-header { display: flex; justify-content: space-around; background-color: #007bff; color: white; } .tab-header div { flex: 1; padding: 15px 0; text-align: center; cursor: pointer; transition: background-color 0.3s, color 0.3s; position: relative; } .tab-header div:hover { background-color: #0056b3; } .tab-header .active { background-color: #0056b3; color: #ffc107; } .tab-header .active::after { content: '⬇'; font-size: 20px; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); } .tab-content { display: none; padding: 20px; animation: fadeIn 0.5s ease-in-out; } .tab-content.active { display: block; } @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } </style> </head> <body> <div class="tabs-container"> <div class="tab-header"> <div class="active" onclick="openTab(event, 'tab1')">🏠 Home</div> <div onclick="openTab(event, 'tab2')">📄 About</div> <div onclick="openTab(event, 'tab3')">📞 Contact</div> </div> <div class="tab-content active" id="tab1"> <h2>🏠 Home</h2> <p>Welcome to the home page! Here you'll find the latest updates and news.</p> </div> <div class="tab-content" id="tab2"> <h2>📄 About</h2> <p>Learn more about our mission, vision, and the team behind this project.</p> </div> <div class="tab-content" id="tab3"> <h2>📞 Contact</h2> <p>Get in touch with us through this contact page. We'd love to hear from you!</p> </div> </div> <script> function openTab(event, tabId) { const tabHeaders = document.querySelectorAll('.tab-header div'); const tabContents = document.querySelectorAll('.tab-content'); tabHeaders.forEach(header => { header.classList.remove('active'); }); tabContents.forEach(content => { content.classList.remove('active'); }); event.currentTarget.classList.add('active'); document.getElementById(tabId).classList.add('active'); } </script> </body> </html>