Closed codingbootcampseu closed 3 years ago
Create a custom radio buttons like this using CSS only.
Requirements
Hints
Use all: unset; to reset all styles for an input element.
all: unset;
.custom-radio-button { all: unset; /* Your checkbox styles */ }
A pseudo element (::before or ::after) can be used to display the selected state (which can then be animated).
::before
::after
.custom-radio::before { content: ''; display: block; ... }
Don't forget to include the name attribute to be able so switch between the different options.
<input class="custom-radio" type="radio" value="one" name="test" checked /> <input class="custom-radio" type="radio" value="two" name="test" /> <input class="custom-radio" type="radio" value="three" name="test" />
tricky
Create a custom radio buttons like this using CSS only.
Requirements
Hints
Use
all: unset;
to reset all styles for an input element.A pseudo element (
::before
or::after
) can be used to display the selected state (which can then be animated).Don't forget to include the name attribute to be able so switch between the different options.