0
So habe ich versucht, eine Website zu machen, wo, wenn Sie einen img
klicken, ein roter Block, 100% Breite, 100% Höhe, alles abdeckt.Etikett mit IMG für Ereignis
body {
margin: 0;
background-color: white;
}
h1 {
font-size: 50px;
text-align: center;
font-family: Raleway;
color: red;
margin-top: 5%;
}
img {
margin-left: auto;
margin-right: auto;
display: block;
}
.redcover {
margin-top: -10%;
position: absolute;
width: 100%;
height: 110%;
background: red;
margin-left: -90%;
transition: all .3s ease-in-out;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
}
#redcovertoggle:checked~.redcover {
margin-left: 0%;
}
<div class="redcover"></div>
<h1>HERZENSSACHE</h1>
<label>
\t \t <input type="checkbox" for="redcovertoggle">
\t \t <img src="https://image.ibb.co/d2aN15/heart2.png" alt="redcovertoggleheart">
\t \t </label>
Ich habe bereits versucht for="redcovertoggle"
in der Label-Tag, aber alle es tut, ist die img
Anschlag wie ein Etikett handeln machen.