I am trying to have a checkbox change the content of a div but if the content isn't together (in the same div), then it will not work.
HTML:
CSS:
.check:before {
display: block;
width: 100px;
height: 100px;
background: red;
content:'';
}
input:checked ~ .check:before {
content:'Content';
}
JSFiddle: https://jsfiddle.net/pgkwn4j6/
No comments:
Post a Comment