SzabiSch / bootcamp-schedule

0 stars 0 forks source link

HTML&CSS Kata: Custom Radio Buttons #42

Closed codingbootcampseu closed 2 years ago

codingbootcampseu commented 3 years ago

Create a custom radio buttons like this using CSS only.

image

Requirements

Hints

Use all: unset; to reset all styles for an input element.

.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).

.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" />
SzabiSch commented 2 years ago

tricky