<!-- using Noto Emoji : https://fonts.google.com/noto/specimen/Noto+Emoji -->
<!-- using Noto Sans Symbols 2 : https://fonts.google.com/noto/specimen/Noto+Sans+Symbols+2 -->
<h1>Emoji Radio Buttons</h1>
<main>
<section id="pattern1">
<h2>Face</h2>
<input type="radio" name="g1" id="g1_1" checked><label for="g1_1">Yes</label><br />
<input type="radio" name="g1" id="g1_2"><label for="g1_2">No</label><br />
<input type="radio" name="g1" id="g1_3"><label for="g1_3">N/A</label>
</section>
<section id="pattern2">
<h2>Hatching</h2>
<input type="radio" name="g2" id="g2_1" checked><label for="g2_1">Pattern1</label><br />
<input type="radio" name="g2" id="g2_2"><label for="g2_2">Pattern2</label><br />
<input type="radio" name="g2" id="g2_3"><label for="g2_3">Pattern3</label><br />
<input type="radio" name="g2" id="g2_4"><label for="g2_4">Pattern4</label>
</section>
<section id="pattern3">
<h2>Transportation</h2>
<input type="radio" name="g3" id="g3_1" checked><label for="g3_1">on Foot</label><br />
<input type="radio" name="g3" id="g3_2"><label for="g3_2">by Bicycle</label><br />
<input type="radio" name="g3" id="g3_4"><label for="g3_4">by Car</label><br />
<input type="radio" name="g3" id="g3_5"><label for="g3_5">by Train</label>
</section>
<section id="pattern4">
<h2>Animal</h2>
<input type="radio" name="g4" id="g4_1" checked><label for="g4_1">Cat</label><br />
<input type="radio" name="g4" id="g4_2"><label for="g4_2">Dog</label><br />
<input type="radio" name="g4" id="g4_3"><label for="g4_3">Bird</label><br />
</section>
<section id="pattern5">
<h2>Animation</h2>
<input type="radio" name="g5" id="g5_1" checked><label for="g5_1">Label1</label><br />
<input type="radio" name="g5" id="g5_2"><label for="g5_2">Label2</label><br />
<input type="radio" name="g5" id="g5_3"><label for="g5_3">Label3</label><br />
</section>
<section id="pattern6">
<h2>Push design</h2>
<label><input type="radio" name="g6" checked>☀️</label>
<label><input type="radio" name="g6">☁️</label>
<label><input type="radio" name="g6">☔</label>
</section>
</main>
<footer>
<p>Emoji Font : <a href="https://fonts.google.com/noto/specimen/Noto+Emoji" target="_blank">Noto Emoji</a> , <a href="https://fonts.google.com/noto/specimen/Noto+Sans+Symbols+2" target="_blank">Noto Sans Symbols 2</a></p>
</footer>
@import url("https://fonts.googleapis.com/css2?family=Noto+Emoji:wght@700&family=Noto+Sans+Symbols+2&family=Spectral:wght@600&display=block");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
overscroll-behavior-x: none;
overscroll-behavior-y: none;
}
body {
background: lightblue;
color: #828e2dc4;
position: relative;
font-family: "Spectral", serif;
font-size: 20px;
width: 100vw;
height: auto;
min-height: 100vh;
text-align: center;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
h1 {
font-size: 7vw;
text-align: center;
}
h2 {
font-size: 25px;
color: white;
}
main {
margin: 5px 0;
}
section {
position: relative;
display: inline-block;
text-align: left;
vertical-align: top;
margin: 0 13px;
}
input,
input::before,
label {
user-select: none;
user-select: none;
user-select: none;
user-select: none;
}
label {
position: relative;
font-size: 18px;
margin-left: 5px;
vertical-align: top;
cursor: pointer;
color: #333;
}
#pattern1 input[type="radio"]::before {
font-family: "Noto Emoji", sans-serif;
position: absolute;
top: -3.5px;
left: -4.2px;
width: 25px;
height: 25px;
font-size: 21.5px;
content: "";
opacity: 0;
transition: opacity 0.3s;
}
#pattern1 input[type="radio"]:nth-of-type(1)::before {
content: "🙂";
}
#pattern1 input[type="radio"]:nth-of-type(2)::before {
content: "🙁";
}
#pattern1 input[type="radio"]:nth-of-type(3)::before {
content: "😐";
}
#pattern1 input[type="radio"] {
appearance: none;
appearance: none;
appearance: none;
position: relative;
width: 25px;
height: 25px;
background-color: #fff;
color: coral;
border: 3px solid gray;
border-radius: 50%;
transition: border-color 0.3s;
}
#pattern1 input[type="radio"]:checked {
border-color: coral;
}
#pattern1 input[type="radio"]:checked::before {
opacity: 1;
}
#pattern2 input[type="radio"] {
appearance: none;
appearance: none;
appearance: none;
position: relative;
width: 25px;
height: 25px;
background-color: #fff;
color: coral;
border: 1px solid gray;
border-radius: 50%;
transition: border-color 0.3s;
}
#pattern2 input[type="radio"]::before {
font-family: "Noto Emoji", sans-serif;
position: absolute;
top: -3px;
left: -4px;
width: 25px;
height: 25px;
font-size: 25px;
content: "";
opacity: 0;
transition: opacity 0.3s;
}
#pattern2 input[type="radio"]:nth-of-type(1)::before {
content: "🟣";
}
#pattern2 input[type="radio"]:nth-of-type(2)::before {
content: "🟠";
}
#pattern2 input[type="radio"]:nth-of-type(3)::before {
content: "🟡";
}
#pattern2 input[type="radio"]:nth-of-type(4)::before {
content: "⚫";
}
#pattern2 input[type="radio"]:checked {
border-color: coral;
}
#pattern2 input[type="radio"]:checked::before {
opacity: 1;
}
#pattern3 input[type="radio"] {
appearance: none;
appearance: none;
appearance: none;
position: relative;
width: 25px;
height: 25px;
color: coral;
background-color: #fff;
border-radius: 50%;
transition: background-color 0.3s ease;
}
#pattern3 input[type="radio"]::before {
font-family: "Noto Emoji", sans-serif;
position: absolute;
top: -4px;
left: -4px;
width: 25px;
height: 25px;
font-size: 25px;
content: "";
opacity: 0;
transition: opacity 0.3s;
}
#pattern3 input[type="radio"]:nth-of-type(1)::before {
content: "🚶";
}
#pattern3 input[type="radio"]:nth-of-type(2)::before {
font-family: "Noto Sans Symbols 2", "Noto Emoji", sans-serif;
content: "🚲";
}
#pattern3 input[type="radio"]:nth-of-type(3)::before {
content: "🚗";
}
#pattern3 input[type="radio"]:nth-of-type(4)::before {
content: "🚃";
}
#pattern3 input[type="radio"]:checked {
background-color: transparent;
}
#pattern3 input[type="radio"]:checked::before {
opacity: 1;
}
#pattern4 input[type="radio"] {
appearance: none;
appearance: none;
appearance: none;
position: relative;
width: 25px;
height: 25px;
color: coral;
background-color: #fff;
border-radius: 50%;
transition: all 0.3s;
}
#pattern4 input[type="radio"]::before {
font-family: "Noto Sans Symbols 2", sans-serif;
position: absolute;
top: 4px;
left: 2px;
width: 25px;
height: 25px;
font-size: 25px;
line-height: 25px;
content: "";
opacity: 0;
transition: all 0.3s;
}
#pattern4 input[type="radio"]:nth-of-type(1)::before {
content: "🐈";
}
#pattern4 input[type="radio"]:nth-of-type(2)::before {
content: "🐕";
}
#pattern4 input[type="radio"]:nth-of-type(3)::before {
content: "🐦";
}
#pattern4 input[type="radio"]:checked {
transform: scale(0.5);
}
#pattern4 input[type="radio"]:checked::before {
opacity: 1;
transform: scale(2.3);
}
#pattern5 input[type="radio"] {
appearance: none;
appearance: none;
appearance: none;
position: relative;
width: 25px;
height: 25px;
display: inline-block;
text-align: center;
color: coral;
background-color: #fff;
border-radius: 50%;
}
#pattern5 input[type="radio"]::before {
font-family: serif;
position: relative;
top: 0;
left: 0;
font-size: 25px;
width: 25px;
height: 25px;
display: inline-block;
line-height: 1;
content: "";
opacity: 0;
transition: opacity 0.3s;
}
#pattern5 input[type="radio"]:nth-of-type(1)::before {
content: "❉";
}
#pattern5 input[type="radio"]:nth-of-type(2)::before {
content: "✿";
}
#pattern5 input[type="radio"]:nth-of-type(3)::before {
content: "✾";
}
#pattern5 input[type="radio"]:checked::before {
opacity: 1;
animation: rotation 1s linear infinite;
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
#pattern6 label {
font-family: "Noto Emoji", sans-serif;
display: inline-block;
position: relative;
box-sizing: border-box;
text-decoration: none;
color: #fff;
width: 40px;
height: 40px;
line-height: 20px;
padding: 5px;
font-size: 17px;
border-radius: 50%;
text-align: center;
font-weight: bold;
box-shadow: inset 0 2px 0px rgba(255, 255, 255, 0.25),
inset 0 -2px 0px rgba(0, 0, 0, 0.18);
transition: 0.3s;
background: lightgray;
border: solid 5px lightgray;
}
#pattern6 label:has(input:checked) {
background-color: coral;
border-color: coral;
box-shadow: inset 1px 2px 0px rgba(0, 0, 0, 0.18),
inset -1px -2px 0px rgba(255, 255, 255, 0.25);
/*
border: dotted 5px coral;
box-shadow: none;
*/
}
#pattern6 input {
appearance: none;
appearance: none;
appearance: none;
display: none;
}
footer {
position: relative;
bottom: 1px;
left: 0;
right: 0;
margin-top: 10px;
font-size: 13px;
color: #333;
text-align: center;
}
footer a {
color: #333;
}
window.onload = function () {
"use strict";
};
This Pen doesn't use any external CSS resources.