Highly Styled Grid System - 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>Highly Styled Grid System</title> <style> body { font-family: 'Arial', sans-serif; background-color: #f4f4f9; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; } .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; padding: 20px; width: 80%; background: #fff; border-radius: 15px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); animation: fadeIn 1s ease-in-out; } .grid-item { background: #e0f7fa; border-radius: 10px; padding: 20px; text-align: center; font-size: 1.2em; position: relative; overflow: hidden; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; } .grid-item:hover { transform: translateY(-10px); background: #b2ebf2; } .grid-item:before { content: '🌟'; position: absolute; top: -10px; left: -10px; font-size: 2em; animation: spin 4s linear infinite; } .grid-item:after { content: '✨'; position: absolute; bottom: -10px; right: -10px; font-size: 2em; animation: spin 4s linear infinite reverse; } @keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } </style> </head> <body> <div class="container"> <div class="grid-item">Item 1 <i class="fas fa-star"></i></div> <div class="grid-item">Item 2 <i class="fas fa-heart"></i></div> <div class="grid-item">Item 3 <i class="fas fa-moon"></i></div> <div class="grid-item">Item 4 <i class="fas fa-sun"></i></div> <div class="grid-item">Item 5 <i class="fas fa-smile"></i></div> <div class="grid-item">Item 6 <i class="fas fa-crown"></i></div> </div> <script src="https://kit.fontawesome.com/a076d05399.js"></script> <script> // JavaScript for additional interactivity document.querySelectorAll('.grid-item').forEach(item => { item.addEventListener('click', () => { alert('You clicked on ' + item.textContent.trim()); }); }); </script> </body> </html>