This is an extreme simplification of what I'm doing with my website, but seems to be the root issue.
I have a <div>
that I want to move when the user clicks some text. Borrowing from this example, I want to add an invisible <input>
checkbox and an associated <label>
.
The mentioned example has full functionality in my browser, but the animation in my code only works when the <label>
is commented out. Is anyone else having this issue? Is there an error I'm missing? Thanks.
/*
input[type="checkbox"] {
display: none;
}
*/
#page_euler {
position: relative;
background-color: gray;
width: 200px;
height: 200px;
left: 0px;
transition: all 0.5s;
}
.click:not(:checked)+#page_euler {
left: 575px;
}
<input class="click" id="slide_euler" type="checkbox">
<!--
<label class="click" for="slide_euler">Click</label>
-->
<div id="page_euler"></div>