Smiley Rating System (Custom Radio Buttons CSS)

In this example below you will see how to do a Smiley Rating System (Custom Radio Buttons CSS) with some HTML / CSS and Javascript

This is a very simple rating system that uses smiley faces to measure customer satisfaction. The styling is created with only CSS and the radio button html property.

This awesome code was written by wiseoldman, you can see more from this user in the personal repository.
You can find the original code on
Copyright wiseoldman ©


  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>Smiley Rating System (Custom Radio Buttons CSS)</title>
      <link rel="stylesheet" href="css/style.css">



  <form id="smileys">
	<input type="radio" name="smiley" value="sad" class="sad">
	<input type="radio" name="smiley" value="neutral" class="neutral">
	<input type="radio" name="smiley" value="happy" class="happy" checked="checked">
	<div>It looks like you're feeling <span id="result">happy</span> today..</div>

<a class="mtt" href="" target="_blank">
	With <span>♥</span> from Morning Train
  <script src=''></script>


    <script  src="js/index.js"></script>



/*Downloaded from */
body {
  align-items: center;
  display: flex;
  font-family: Helvetica, sans-serif;
  height: 100vh;
  justify-content: center;
  margin: 0;
body div {
  font-size: 15px;
  margin-top: 15px;
  text-align: center;

form#smileys input[type="radio"] {
  -webkit-appearance: none;
  width: 90px;
  height: 90px;
  border: none;
  cursor: pointer;
  transition: border .2s ease;
  -webkit-filter: grayscale(100%);
          filter: grayscale(100%);
  margin: 0 5px;
  transition: all .2s ease;
form#smileys input[type="radio"]:hover, form#smileys input[type="radio"]:checked {
  -webkit-filter: grayscale(0);
          filter: grayscale(0);
form#smileys input[type="radio"]:focus {
  outline: 0;
form#smileys input[type="radio"].happy {
  background: url("") center;
  background-size: cover;
form#smileys input[type="radio"].neutral {
  background: url("") center;
  background-size: cover;
form#smileys input[type="radio"].sad {
  background: url("") center;
  background-size: cover;

.mtt {
  position: fixed;
  bottom: 10px;
  right: 20px;
  color: #999;
  text-decoration: none;
.mtt span {
  color: #e74c3c;
.mtt:hover {
  color: #666;
.mtt:hover span {
  color: #c0392b;

/*Downloaded from */
// Simple jQuery for updating the text
// when a radio button is clicked
$('#smileys input').on('click', function() {