Playful 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>Playful Tabs</title> <style> body { font-family: 'Arial', sans-serif; background-color: #ffe0b2; 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: #ff9800; 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: #e65100; } .tab-header .active { background-color: #e65100; color: #ffff00; } .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, 'playful-home')">🏡 Home</div> <div onclick="openTab(event, 'playful-services')">🔧 Services</div> <div onclick="openTab(event, 'playful-gallery')">🖼️ Gallery</div> </div> <div class="tab-content active" id="playful-home"> <h2>🏡 Home</h2> <p>Welcome to our playful home page! Stay updated with the latest fun activities.</p> </div> <div class="tab-content" id="playful-services"> <h2>🔧 Services</h2> <p>Explore our range of fun services designed to bring joy and excitement.</p> </div> <div class="tab-content" id="playful-gallery"> <h2>🖼️ Gallery</h2> <p>Check out our gallery to see some of our recent fun-filled events and activities.</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>