logo

18 Oct 2021

HTML & CSS:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 <style> @import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap"); *{ margin: 0; padding: 0; box-sizing: border-box; font-family: "Poppins", sans-serif; } body { display: flex; justify-content: center; align-items: center; height: 100vh; } .card { width: 250px; height: 300px; position: relative; cursor: pointer; } .card .content { width: 100%; height: 100%; background: rgba(255, 255, 255, 0.089); backdrop-filter: blur(20px); border: 1px solid white; color: white; display: flex; justify-content: center; align-items: center; flex-direction: column; box-shadow: 0 0 30px rgba(0, 0, 0, 0.055); transition: all 0.4s; } .card .content p { font-size: 0.8em; padding: 0.3em 1.5em; text-align: center; } .card:hover .content { color: rgb(36, 36, 36); } .card::before, .card::after { content: ""; position: absolute; width: 100%; height: 50%; background: #7f00ff; z-index: -20; transition: all 0.4s; } .card::before { top: 0; right: 0; } .card::after { bottom: 0; left: 0; background: #e100ff; } .card:hover::before { width: 50px; height: 50px; transform: translate(20px, -20px); border-radius: 50%; } .card:hover::after { width: 100px; height: 100px; transform: translate(-20px, 20px); border-radius: 50%; } </style> <div class="card"> <div class="content"> <h1>Hello</h1> <p> Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero, necessitatibus? </p> </div> </div>