# How to style checkboxes?

**URL:** <https://discourse.cakephp.org/t/how-to-style-checkboxes/3151>\
**Category:** Need Help\
**Created:** [September 9, 2017, 11:41am UTC](https://discourse.cakephp.org/t/how-to-style-checkboxes/3151 "2017-09-09T11:41:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dolando](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@Dolando](https://discourse.cakephp.org/u/Dolando)\
**Post date:** [September 9, 2017, 11:41am UTC](https://discourse.cakephp.org/t/how-to-style-checkboxes/3151/1 "2017-09-09T11:41:05Z")

</div>

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.
