How can I eliminate the overflow issue with this toggle button?
The functionality of this toggle button is simple - you click on it to turn it on and off.
I've been struggling to find a solution. Every attempt so far has been unsuccessful.
All I want to do is remove the overflow, but I can't seem to figure it out.
If anyone has any suggestions or ideas on how to achieve this, please let me know.
Check out the toggle button here
https://i.sstatic.net/0rp6X.png
(function() {
"use strict";
const onOffButton = document.querySelector(".switch");
function switchButton() {
onOffButton.classList.toggle("on");
}
onOffButton.addEventListener("click", switchButton);
})();
.switch {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
background-color: black;
width: 150px;
height: 195px;
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0 1px 2px black, inset 0 2px 2px -2px white, inset 0 0 2px 15px #47434c, inset 0 0 2px 22px black;
border-radius: 5px;
padding: 20px;
perspective: 700px;
}
...