How to style checkboxes?


#1

Please tell me, how I can get red oder blue checkboxes.
My form for testing this looks like this:

echo $this->Form->create(null, [‘id’ => “meinFormular”]);
echo $this->Form->checkbox(‘Feld A’, [‘checked’ => true, ‘hiddenField’ => false, ‘class’ => ‘rot’]);
echo " Feld A"; echo “
”;
echo $this->Form->checkbox(‘Feld B’, [‘checked’ => false, ‘hiddenField’ => false, ‘class’ => ‘blau’]);
echo " Feld B"; echo “
”;
echo $this->Form->end();

My css-File looks like this;
.rot {
background-color: yellow;
color: red;
border: 2px solid;
border-color: red;
}

.blau {
background-color: yellow;
color: blue;
border: 2px solid;
border-color: blue;
}

Unfortunately it does not work. I use CakePHP 3.3.7.
Thank you very much for any help.