Complete the code to change the text color of the sibling <p> when the checkbox is checked.
<input type="checkbox" id="toggle" class="peer" /> <p class="[1]">This text changes color when checkbox is checked.</p>
checked: instead of peer-checked:peer class to the checkboxThe peer-checked: modifier applies styles to siblings when the peer element (checkbox) is checked.
Complete the code to make the sibling <div> visible only when the checkbox is checked.
<input type="checkbox" id="show" class="peer" /> <div class="hidden [1]">Visible when checked</div>
checked:block which does not affect siblingshiddenThe peer-checked:block class makes the sibling div display as block when the checkbox is checked.
Fix the error in the code to change the sibling <span> text to red when the checkbox is checked.
<input type="checkbox" id="check" class="peer" /> <span class="[1]">Change my color</span>
checked: which does not affect siblingshover: or focus: which are unrelated hereOnly peer-checked: applies styles to sibling elements based on the peer's checked state.
Fill both blanks to make the sibling <div> background green and text white when the checkbox is checked.
<input type="checkbox" id="bg-toggle" class="peer" /> <div class="[1] [2]">Styled on check</div>
checked: instead of peer-checked:peer-checked:bg-green-500 changes background and peer-checked:text-white changes text color when checkbox is checked.
Fill all three blanks to make the sibling <button> scale up, change background, and show shadow when the checkbox is checked.
<input type="checkbox" id="scale-toggle" class="peer" /> <button class="transform transition [1] [2] [3]">Hover me</button>
hover: instead of peer-checked:transform class which is needed for scalingUsing peer-checked: modifiers applies scale, background color, and shadow to the button when the checkbox is checked.