Onclick radio buttons to change background color We are displaying two radio buttons in page. Click on Radio buttons, it will change background color.  Is there any way to improve the quality of the code?



html,
body {
  width: 100%;
  height: 100%;  
  margin: 0;
  padding: 0;
  text-align: center;
}

body {
  box-sizing: border-box;
  padding-top: 180px;
  background: #ffffff;
}

input {
  display: none;
}

.button {
  display: inline-block;
  position: relative;
  width: 50px;
  height: 50px;
  margin: 10px;
  cursor: pointer;
}

.button span {
  display: block;
  position: absolute;
  width: 50px;
  height: 50px;
  padding: 0;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -o-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  border-radius: 100%;
  background: #eeeeee;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
  transition: ease .3s;
}

.button span:hover {
  padding: 10px;
}

.orange .button span {
  background: #FF5722;
}

.amber .button span {
  background: #FFC107;
}


.layer {
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: transparent;
  /*transition: ease .3s;*/
  z-index: -1;
}

.orange input:checked ~ .layer {
  background: #F4511E;
}

.amber input:checked ~ .layer {
  background: #FFB300;
}
&lt;body&gt;
 
&lt;label class="orange"&gt;
  &lt;input type="radio" name="color" value="orange"&gt;
  &lt;div class="layer"&gt;&lt;/div&gt;
  &lt;div class="button"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/label&gt;

&lt;label class="amber"&gt;
  &lt;input type="radio" name="color" value="amber"&gt;
  &lt;div class="layer"&gt;&lt;/div&gt;
  &lt;div class="button"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/label&gt;


&lt;/body&gt;
The code looks pretty good. I only see a couple CSS rules that appear to be useless - for instance:

background: #eeeeee;


under the ruleset:

.button span {


But that style is overridden by the background styles under the &lt;label&gt; tags (i.e. .orange .button span and .amber .button span). The only reason I could think that would be needed is if you have other HTML not included in the example above that would have other colors...



What is the goal of the styles for html? I read the answers to Styling the &lt;html&gt; element in CSS? and it leads me to believe it is an attempt to avoid scrollbars, but maybe that is incorrect.



And is it really necessary to specify 

background: #ffffff;


for the body tag? Maybe there are browser settings I am unaware of that allow a user to have a default background color other than that??