-
CSS Bubble navigation
HTML
CSS
JavaScript
🏠
Home
👤
About
⚙️
Services
✉️
Contact
*{ margin:0; padding:0; box-sizing:border-box; font-family:Arial,sans-serif; } body{ min-height:100vh; display:flex; justify-content:center; align-items:center; background:#111827; } .nav{ display:flex; gap:20px; } .nav a{ position:relative; width:70px; height:70px; border-radius:50px; background:#1f2937; text-decoration:none; overflow:hidden; display:flex; align-items:center; justify-content:center; color:#fff; transition:.5s; } .nav a:hover{ width:180px; } /* Icon */ .icon{ position:absolute; left:50%; transform:translateX(-50%); font-size:28px; transition:.5s; z-index:2; } .nav a:hover .icon{ left:25px; transform:none; } /* Text */ .text{ position:absolute; left:70px; opacity:0; transform:translateX(20px); transition:.4s; transition-delay:.2s; font-size:18px; letter-spacing:1px; } .nav a:hover .text{ opacity:1; transform:translateX(0); } /* Bubbles */ .bubble{ position:absolute; border-radius:50%; background:rgba(255,255,255,.4); opacity:0; } .b1{ width:10px; height:10px; left:15px; bottom:10px; } .b2{ width:15px; height:15px; left:30px; bottom:15px; } .b3{ width:20px; height:20px; left:50px; bottom:12px; } .nav a:hover .b1{ animation:rise 1s ease forwards; } .nav a:hover .b2{ animation:rise 1s ease .15s forwards; } .nav a:hover .b3{ animation:rise 1s ease .3s forwards; } @keyframes rise{ from{ opacity:0; transform:translateY(0) scale(0); } to{ opacity:1; transform:translateY(-60px) scale(1); } } /* Colors */ .home:hover{ background:#3b82f6; } .about:hover{ background:#8b5cf6; } .service:hover{ background:#10b981; } .contact:hover{ background:#f97316; }
Live Preview