Stylish Details Summary - 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>Stylish Details Summary</title> <style> body { font-family: 'Arial', sans-serif; background: linear-gradient(45deg, #6B73FF, #000DFF); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; color: #FFF; } details { position: relative; width: 80%; max-width: 600px; margin: 20px auto; background: rgba(255, 255, 255, 0.1); border: 2px solid #FFF; border-radius: 10px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); overflow: hidden; transition: all 0.3s ease; } details[open] { background: rgba(255, 255, 255, 0.2); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4); } summary { cursor: pointer; padding: 20px; font-size: 1.5em; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; } summary::marker { display: none; } summary:hover { background: rgba(255, 255, 255, 0.1); } .icon { margin-left: 10px; transition: transform 0.3s ease; } details[open] .icon { transform: rotate(90deg); } .content { padding: 20px; font-size: 1.2em; border-top: 2px solid #FFF; animation: slideDown 0.5s ease-in-out; } @keyframes slideDown { 0% { transform: translateY(-10px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } } .emoji { font-size: 1.5em; margin-right: 10px; } .button { display: inline-block; padding: 10px 20px; font-size: 1em; color: #FFF; background: #000DFF; border: none; border-radius: 5px; cursor: pointer; transition: background 0.3s ease; } .button:hover { background: #6B73FF; } </style> </head> <body> <details> <summary> <span class="emoji">🔍</span> Click for More Info <span class="icon">➤</span> </summary> <div class="content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <button class="button">Learn More</button> </div> </details> <script> document.querySelectorAll('summary').forEach(summary => { summary.addEventListener('click', event => { const details = summary.parentElement; document.querySelectorAll('details').forEach(d => { if (d !== details) { d.removeAttribute('open'); } }); }); }); </script> </body> </html>