square1 css5

Data utworzenia: 2024-12-17 08:34:33
* { box-sizing: 0; padding: 0; margin: 0; } body { font-family:Georgia, 'Times New Roman', Times, serif; background-color: #333; } button { position: absolute; top: 50px; width: 150px; padding: 10px 30px; background-color: #333; transform: translateX(-50%); border: 2px solid white; color: white; text-transform: uppercase; cursor: pointer; } button:hover { background-color: white; color: black; transition: 1s; } .btn-zoom { left: 30%; } .btn-move { left: 50%; } .btn-color { left: 70%; } .square { position: absolute; top: 150px; width: 100px; height: 100px; transform: translateX(-50%); border-radius: 15px; background-color: white; transition: 1s; } .blue { background-color: rgb(54,129,227); left: 30%; border: 2px solid blue; box-shadow: 0 0 rgb(54,129,227); } .red { background-color: rgb(247, 60, 60); left: 50%; border: 2px solid red; box-shadow: 0 0 rgb(247, 60, 60); } .green { background-color: rgb(76, 255, 76); left: 70%; border: 2px solid green; box-shadow: 0 0 rgb(76, 255, 76); } .btn-zoom:hover ~ .square{ width: 200px; height: 200px; } .btn-move:hover ~ .square { top: 400px; } .btn-color:hover ~ .square { background-color: rgb(255, 255, 107); border: 2px solid yellow; }
Powrót