1

I don't really like the look of Chromes checkbox, so I tried styling it using css but I guess it didn't work.

enter image description here

input[type="checkbox"]
    {
    border: 2px solid black;
    outline: 0;
    background: transparent;

}
Ikhlak S.
  • 8,578
  • 10
  • 57
  • 77

2 Answers2

1

HTML

<input type="checkbox" class="customCheckBox large" />

CSS

    .customCheckBox[type="checkbox"]:after{
        position: relative;
        display: block;
        left: 2px;
        top: -11px;
        width: 7px;
        height: 7px;
        border-width: 1px;
        border-style: solid;
        border-color: #B3B3B3 #dcddde #dcddde #B3B3B3;
        content: "";
        background-repeat: no-repeat;
        background-position:center;
    }

    .customCheckBox[type="checkbox"]:before{
        border: 1px solid #808080;
        content: "";
        background: #FFF;
        position: relative;
        display: block;
        width: 11px;
        height: 11px;

    }
    .customCheckBox[type="checkbox"]:checked:after{
        background-image:  url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAQAAABuW59YAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAB2SURBVHjaAGkAlv8A3QDyAP0A/QD+Dam3W+kCAAD8APYAAgTVZaZCGwwA5wr0AvcA+Dh+7UX/x24AqK3Wg/8nt6w4/5q71wAAVP9g/7rTXf9n/+9N+AAAtpJa/zf/S//DhP8H/wAA4gzWj2P4lsf0JP0A/wADAHB0Ngka6UmKAAAAAElFTkSuQmCC');
    }
    /* Large checkboxes */
    .customCheckBox.large{
        height:22px;
        width: 22px;
    }

    .customCheckBox.large[type="checkbox"]:before{
        width: 20px;
        height: 20px;
    }
    .customCheckBox.large[type="checkbox"]:after{
        top: -20px;
        width: 16px;
        height: 16px;
    }

Giving large class because you probably would like to add one more type of style in your css or size of checkbox here :-)

Maulik Suchak
  • 1,028
  • 1
  • 8
  • 23
0

Stackoverflow :How to style checkbox using CSS?

Hongkiat :Customize Checkboxes And Radio Buttons

CSScheckbox : http://www.csscheckbox.com/

Community
  • 1
  • 1
Suman KC
  • 3,478
  • 4
  • 30
  • 42