So when a checkbox is checked, and you are targeting the label immediately after it: input[type=checkbox] + label { color: #ccc; font-style: italic; } input[type=checkbox]:checked + label { color: #f00; font-style: normal; } For example, set the width and padding as follows. This effect gives a new look to the checkbox. Get certifiedby completinga course today! Write CSS OR LESS and hit save.
. Example: In the same way, created 2 other inputs, you can create many inputs as your requirement. In there, the class is to giving styles, ID is for matching the label. That’s It. Today you will learn to create an Input label animation. A red asterix is a common approach in website UX to show that a form field is required to be filled out by the using before submitting the form.