Change CheckBox image to custom image - html

I have created a div with custom checkbox and i want to change the checkbox image by the custom image. and i have done it but i am unable to change the size of the image.Please help me.
Any help will be appreciated.
<div class="left">
<input id="Option" type="checkbox">
<label class="checkbox" for="Option"> </label>
</div>
And CSS which i have used.
.checkbox {
display: inline-block;
cursor: pointer;
font-size: 13px; line-height:18px;
}
input[type=checkbox] {
display:none;
}
.checkbox:before {
content: "";
display: inline-block;
width: 25px;
height: 25px;
vertical-align: middle;
background-color: rgb(248,183,51);
color: #f3f3f3;
text-align: center;
}
input[type=checkbox]:checked + .checkbox:before {
content: url("images/Tick.png");
text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
font-size: 15px;
}

You can do this without using images, just with simple characters and CSS, so you can make change on your custom checkbox just with adjusting font-size or changing color.
Please see the below example:
/* Base for label styling */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
[type="checkbox"]:not(:checked) + label,
[type="checkbox"]:checked + label {
position: relative;
padding-left: 25px;
cursor: pointer;
}
/* checkbox aspect */
[type="checkbox"]:not(:checked) + label:before,
[type="checkbox"]:checked + label:before {
content: '';
position: absolute;
left:0; top: 2px;
width: 17px; height: 17px;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 3px;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
/* checked mark aspect */
[type="checkbox"]:not(:checked) + label:after,
[type="checkbox"]:checked + label:after {
content: '✔';
position: absolute;
top: 3px; left: 4px;
font-size: 18px;
line-height: 0.8;
color: #09ad7e;
transition: all .1s;
transform-origin: center;
}
/* checked mark aspect changes */
[type="checkbox"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
transform-origin: center;
}
[type="checkbox"]:checked + label:after {
opacity: 1;
transform: scale(1);
transform-origin: center;
}
/* disabled checkbox */
[type="checkbox"]:disabled:not(:checked) + label:before,
[type="checkbox"]:disabled:checked + label:before {
box-shadow: none;
border-color: #bbb;
background-color: #ddd;
}
[type="checkbox"]:disabled:checked + label:after {
color: #999;
}
[type="checkbox"]:disabled + label {
color: #aaa;
}
/* accessibility */
[type="checkbox"]:checked:focus + label:before,
[type="checkbox"]:not(:checked):focus + label:before {
border: 1px dotted blue;
}
/* hover style just for information */
label:hover:before {
border: 1px solid #4778d9!important;
}
/* Useless styles, just for demo design */
body {
font-family: "Open sans", "Segoe UI", "Segoe WP", Helvetica, Arial, sans-serif;
color: #777;
}
h1, h2 {
margin-bottom: 5px;
font-weight: normal;
text-align: center;
}
h2 {
margin: 5px 0 2em;
color: #aaa;
}
form {
width: 80px;
margin: 0 auto;
}
.txtcenter {
margin-top: 4em;
font-size: .9em;
text-align: center;
color: #aaa;
}
.copy {
margin-top: 2em;
}
.copy a {
text-decoration: none;
color: #4778d9;
}
<form action="#">
<p>
<input type="checkbox" id="test1" />
<label for="test1">Red</label>
</p>
<p>
<input type="checkbox" id="test2" checked="checked" />
<label for="test2">Yellow</label>
</p>
<p>
<input type="checkbox" id="test3" checked="checked" disabled="disabled" />
<label for="test3">Green</label>
</p>
<p>
<input type="checkbox" id="test4" disabled="disabled" />
<label for="test4">Brown</label>
</p>
</form>
or you can check on CodePen as well: Custom Checkbox Without images
(Edited)
Custom Checkbox background-image property
Please check the following live example for a custom checkbox using background-image:
.checkbox {
display: inline-block;
cursor: pointer;
font-size: 13px; line-height:18px;
}
input[type=checkbox] {
display:none;
}
.checkbox:before {
content: "";
display: inline-block;
width: 25px;
height: 25px;
vertical-align: middle;
background-color: rgb(248,183,51);
color: #f3f3f3;
text-align: center;
}
input[type=checkbox]:checked + .checkbox:before {
background: url("https://cdn1.iconfinder.com/data/icons/windows8_icons_iconpharm/26/checked_checkbox.png") no-repeat center center;
text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
font-size: 15px;
background-size: 10px 10px;
}
<div class="left">
<input id="Option" type="checkbox">
<label class="checkbox" for="Option"> </label>
</div>
Please make sure that your image is exist in right path.
Also please consider you can re-position your background image by setting the horizontal and vertical position for background property as well.

Main thing I did was set backgrounds background-size to cover.
.checkbox {
display: inline-block;
cursor: pointer;
font-size: 13px; line-height:18px;
}
input[type=checkbox] {
display:none;
}
.checkbox:before {
content: "";
display: inline-block;
width: 40px;
height: 40px;
vertical-align: middle;
background-color: rgb(248,183,51);
color: #f3f3f3;
text-align: center;
}
input[type=checkbox]:checked + .checkbox:before {
background: url("https://cdn1.iconfinder.com/data/icons/windows8_icons_iconpharm/26/checked_checkbox.png");
text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
font-size: 15px;
background-size: contain;
}
<div class="left">
<input id="Option" type="checkbox">
<label class="checkbox" for="Option"> </label>
</div>

Related

Content Moves on Opening Select Dropdown

I need help with the Select Dropdown. It moves the content (Hello World) when opened. I have used Radio Input to select the specfic option when performing a Search. If there is any other better solution for this type of functionality, please assist.
HTML
<span class="dropdown-el">
<input type="radio" name="sortType" value="Relevance" checked="checked" id="sort-relevance"><label for="sort-relevance">Relevance</label>
<input type="radio" name="sortType" value="Popularity" id="sort-best"><label for="sort-best">Product Popularity</label>
<input type="radio" name="sortType" value="PriceIncreasing" id="sort-low"><label for="sort-low">Price Low to High</label>
<input type="radio" name="sortType" value="PriceDecreasing" id="sort-high"><label for="sort-high">Price High to Low</label>
<input type="radio" name="sortType" value="ProductBrand" id="sort-brand"><label for="sort-brand">Product Brand</label>
<input type="radio" name="sortType" value="ProductName" id="sort-name"><label for="sort-name">Product Name</label>
</span>
<h1> Hello World</h1>
CSS
body {
text-align: center;
background: #ebf4fb;
min-height: 95vh;
margin: 0;
padding: 0;
border-bottom: 5vh solid #3694d7;
font-family: "Myriad Pro", "Arial", sans;
font-size: 24px;
}
.dropdown-el {
margin-top: 20vh;
min-width: 12em;
position: relative;
display: inline-block;
margin-right: 1em;
min-height: 2em;
max-height: 2em;
overflow: hidden;
top: 0.5em;
cursor: pointer;
text-align: left;
white-space: nowrap;
color: #444;
outline: none;
border: 0.06em solid transparent;
border-radius: 1em;
background-color: #cde4f5;
transition: 0.3s all ease-in-out;
}
.dropdown-el input:focus + label {
background: #def;
}
.dropdown-el input {
width: 1px;
height: 1px;
display: inline-block;
position: absolute;
opacity: 0.01;
}
.dropdown-el label {
border-top: 0.06em solid #d9d9d9;
display: block;
height: 2em;
line-height: 2em;
padding-left: 1em;
padding-right: 3em;
cursor: pointer;
position: relative;
transition: 0.3s color ease-in-out;
}
.dropdown-el label:nth-child(2) {
margin-top: 2em;
border-top: 0.06em solid #d9d9d9;
}
.dropdown-el input:checked + label {
display: block;
border-top: none;
position: absolute;
top: 0;
width: 100%;
}
.dropdown-el input:checked + label:nth-child(2) {
margin-top: 0;
position: relative;
}
.dropdown-el::after {
content: "";
position: absolute;
right: 0.8em;
top: 0.9em;
border: 0.3em solid #3694d7;
border-color: #3694d7 transparent transparent transparent;
transition: 0.4s all ease-in-out;
}
.dropdown-el.expanded {
border: 0.06em solid #3694d7;
background: #fff;
border-radius: 0.25em;
padding: 0;
box-shadow: rgba(0, 0, 0, 0.1) 3px 3px 5px 0px;
max-height: 15em;
}
.dropdown-el.expanded label {
border-top: 0.06em solid #d9d9d9;
}
.dropdown-el.expanded label:hover {
color: #3694d7;
}
.dropdown-el.expanded input:checked + label {
color: #3694d7;
}
.dropdown-el.expanded::after {
transform: rotate(-180deg);
top: 0.55em;
}
JQuery
$('.dropdown-el').click(function(e) {
e.preventDefault();
e.stopPropagation();
$(this).toggleClass('expanded');
$('#'+$(e.target).attr('for')).prop('checked',true);
});
$(document).click(function() {
$('.dropdown-el').removeClass('expanded');
});
https://codepen.io/libsys/pen/bGKomaE
Please assist.

designing a horizontal checkbox

I intend to design a multiple choice question using an HTML file in a way that the choices appear horizontally. Here is what I have tried:
<checkbox-answer
options = question.tokens
answer2 = "question.answer"
>
</checkbox-answer>
Tokens refer to the choices that have to appear. However, they appear vertically like this:
choice 1
choice 2
choice 3
How can I modify it so that they appear horizontally like this?:
choice 1 choice 2 choice 3
You can use like this
.dbgOuter{
border: solid 1px #888;
border-radius: 4px;
padding: 3px 8px 0px 14px;
width: 340px;
margin: 0 auto;
font-size: 10.5pt;
}
.dbgCont{
display: inline-block;
height: 24px;
margin-left: 6px;
}
/* Base for label styling */
.dbgCheck:not(:checked),
.dbgCheck:checked {
position: absolute;
left: -9999px;
}
.dbgCheck:not(:checked) + label,
.dbgCheck:checked + label {
display:inline-block;
position: relative;
padding-left: 25px;
cursor: pointer;
}
/* checkbox aspect */
.dbgCheck:not(:checked) + label:before,
.dbgCheck:checked + label:before {
content: '';
position: absolute;
left:0; top: 1px;
width: 17px; height: 17px;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 3px;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
/* checkmark aspect */
.dbgCheck:not(:checked) + label:after,
.dbgCheck:checked + label:after {
content: '✔';
position: absolute;
top: 2px; left: 5px;
font-size: 14px;
color: #09ad7e;
transition: all .2s;
}
/* checked mark aspect changes */
.dbgCheck:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
.dbgCheck:checked + label:after {
opacity: 1;
transform: scale(1);
}
/* disabled checkbox */
.dbgCheck:disabled:not(:checked) + label:before,
.dbgCheck:disabled:checked + label:before {
box-shadow: none;
border-color: #bbb;
background-color: #ddd;
}
.dbgCheck:disabled:checked + label:after {
color: #999;
}
.dbgCheck:disabled + label {
color: #aaa;
}
/* accessibility */
.dbgCheck:checked:focus + label:before,
.dbgCheck:not(:checked):focus + label:before {
border: 1px dotted blue;
}
.dbgCheck{
display:inline-block;
width:90px;
height:24px;
margin:1em;
}
/* Useless styles, just for demo design */
body {
font-family: "Open sans", "Segoe UI", "Segoe WP", Helvetica, Arial, sans-serif;
color: #666;
}
h1, h2 {
margin-bottom: 5px;
font-weight: normal;
text-align: center;
}
h2 {
margin: 5px 0 2em;
color: #aaa;
}
form {
width: 80px;
margin: 0 auto;
}
.txtcenter {
margin-top: 4em;
font-size: .9em;
text-align: center;
color: #aaa;
}
.copy {
margin-top: 2em;
}
.copy a {
text-decoration: none;
color: #4778d9;
}
<h2>horizontal checkboxes</h2>
<div class="dbgOuter">
<div class="dbgCont">
<input type="checkbox" id="dbgTrace" class="dbgCheck" />
<label for="dbgTrace">choice 1</label>
</div>
<div class="dbgCont">
<input type="checkbox" id="dbgDebug" class="dbgCheck" />
<label for="dbgDebug">choice 2</label>
</div>
<div class="dbgCont">
<input type="checkbox" id="dbgInfo" class="dbgCheck" checked="checked" />
<label for="dbgInfo">choice 3</label>
</div>
</div>
<p class="txtcenter">Custom styles on modern browsers.<br/>Classical checkboxes on IE8 and lower.</p>

Custom tick mark in a custom checkobx is not displaying

I have a custom checkbox which I want to add a tick mark inside it when checked
Here is code snippet:
input[type="checkbox"] {
transform: scale(3, 3) !important;
margin: 0px 21px;
}
.checkbox-custom,
.checkbox-custom-label {
display: inline-block;
vertical-align: middle;
margin: 5px 7px;
cursor: pointer;
font-size: 2.4rem;
font-family: "FuturaPT_BOOK";
/* padding: 6px; */
}
[type="checkbox"]:not(:checked)+label:after,
[type="checkbox"]:checked+label:after {
content: '✔';
position: absolute;
top: 8px;
left: 10px;
font-size: 24px;
line-height: 0.8;
color: #fff;
transition: all .2s;
}
.checkbox-custom+.checkbox-custom-label:before {
content: '';
background: #fff;
border: 1px solid #000;
display: inline-block;
vertical-align: middle;
width: 30px;
height: 30px;
padding: 2px;
margin-right: 30px;
text-align: center;
border-radius: 24%;
}
.checkbox-custom:checked+.checkbox-custom-label:before {
background: #0000;
box-shadow: inset 0px 0px 0px 4px #fff;
}
<p class="checkbox">
<input type="checkbox" class="checkbox checkbox-custom" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked" {/if} />
<label class="checkbox-custom-label" for="cgv">{l s='I agree to the terms of service' mod='threepagecheckout'}</label>
{l s='(Read the Terms of Service)' mod='threepagecheckout'}
</p>
unfortunately when I click on check box nothing is displayed, I have tried different combination but nothing worked,
what am I doing wrong?
First you have to hide the default checkbox:
[type="checkbox"] {
display: none
}
Then put some general styling for label:after:
[type="checkbox"]+label:after {
content: '';
position: absolute;
...
}
Then style the :checked state
[type="checkbox"]:checked+label:after {
content: '✔';
}
And also position the tick mark so that it appears correctly in middle of your custom checkbox. Your tick mark was outside the box.
input[type="checkbox"] {
transform: scale(3, 3) !important;
margin: 0px 21px;
}
.checkbox-custom,
.checkbox-custom-label {
display: inline-block;
vertical-align: middle;
margin: 5px 7px;
cursor: pointer;
font-size: 2.4rem;
font-family: "FuturaPT_BOOK";
/* padding: 6px; */
}
[type="checkbox"] {
display: none
}
[type="checkbox"]+label:after {
content: '';
position: absolute;
top: 31px;
left: 23px;
font-size: 24px;
line-height: 0.8;
color: #fff;
transition: all .2s;
}
[type="checkbox"]:checked+label:after {
content: '✔';
}
.checkbox-custom+.checkbox-custom-label:before {
content: '';
background: #fff;
border: 1px solid #000;
display: inline-block;
vertical-align: text-top;
width: 30px;
height: 30px;
padding: 2px;
margin-right: 30px;
text-align: center;
border-radius: 24%;
}
.checkbox-custom:checked+.checkbox-custom-label:before {
background: #000;
box-shadow: inset 0px 0px 0px 4px #fff;
}
<p class="checkbox">
<input type="checkbox" class="checkbox checkbox-custom" name="cgv" id="cgv" value="1" />
<label class="checkbox-custom-label" for="cgv">I agree to the terms of service</label>
Read the Terms of Service
</p>
i have modified my code
/* Base for label styling */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
[type="checkbox"]:not(:checked) + label,
[type="checkbox"]:checked + label {
position: relative;
padding-left: 1.95em;
cursor: pointer;
}
/* checkbox aspect */
[type="checkbox"]:not(:checked) + label:before,
[type="checkbox"]:checked + label:before {
content: '';
position: absolute;
left: 0; top: 0;
width: 1.25em; height: 1.25em;
border: 2px solid #ccc;
background: #fff;
border-radius: 4px;
box-shadow: inset 0 1px 3px rgba(0,0,0,.1);
}
/* checked mark aspect */
[type="checkbox"]:not(:checked) + label:after,
[type="checkbox"]:checked + label:after {
content: '\2713\0020';
position: absolute;
top: .15em; left: .22em;
font-size: 1.3em;
line-height: 0.8;
color: #09ad7e;
transition: all .2s;
font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', Arial;
}
/* checked mark aspect changes */
[type="checkbox"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
[type="checkbox"]:checked + label:after {
opacity: 1;
transform: scale(1);
}
<p class="checkbox">
<input type="checkbox" class="checkbox checkbox-custom" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked" {/if} />
<label class="checkbox-custom-label" for="cgv">{l s='I agree to the terms of service' mod='threepagecheckout'}</label>
{l s='(Read the Terms of Service)' mod='threepagecheckout'}
</p>

How to create a tick mark in a custom checkbox?

I want to make a custom checkbox with CSS, but not sure how do it.
.custom-checkbox {
border: 3px solid #7e8a94;
float: right;
height: 20px;
width: 20px;
border-radius: 5px;
cursor: pointer;
display: inline-block;
}
.custom-checkbox.hover {
border: 3px solid #43D8B0;
}
.custom-checkbox.active {
border: 3px solid #43D8B0;
}
.custom-checkbox.active.checkmark {}
<input type='checkbox' class='checkbox'>
<div class="custom-checkbox">
<div class="checkmark"></div>
</div>
I added active class to custom-checkbox on checking, but not sure how to create a tick inside a box then?
You have to manually customize your input & add a label in a way using pseudo elements to get the desired effect in the checkbox you want here.
Also, you can use content: '✔'; in your css to provide a tick on click.
I built you a demo to refer to, check the following code:
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
[type="checkbox"]:not(:checked)+label,
[type="checkbox"]:checked+label {
position: relative;
padding-left: 25px;
cursor: pointer;
}
[type="checkbox"]:not(:checked)+label:before,
[type="checkbox"]:checked+label:before {
content: '';
position: absolute;
left: 0;
top: -5px;
width: 40px;
height: 40px;
background: #fff;
border-radius: 3px;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .1);
border-radius: 50%;
background-color: #5cf1b3;
outline: none;
}
[type="checkbox"]:not(:checked)+label:after,
[type="checkbox"]:checked+label:after {
content: '✔';
position: absolute;
top: 8px;
left: 10px;
font-size: 24px;
line-height: 0.8;
color: #fff;
transition: all .2s;
}
[type="checkbox"]:not(:checked)+label:after {
opacity: 0;
transform: scale(0);
}
[type="checkbox"]:checked+label:after {
opacity: 1;
transform: scale(1);
}
<p>
<input type="checkbox" id="test1" />
<label for="test1"></label>
</p>
You will need to use :checked pseudo class for it. In the following example it's using a span tag to create the custom checkbox style, and using a pseudo element :before with a special character ✔ inside for the tick.
.custom-checkbox input {
display: none;
}
.custom-checkbox span {
border: 3px solid #7e8a94;
float: right;
height: 20px;
width: 20px;
border-radius: 5px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
.custom-checkbox:hover span,
.custom-checkbox input:checked + span {
border: 3px solid #43D8B0;
}
.custom-checkbox input:checked + span:before {
content: "✔";
}
<label class="custom-checkbox">
<input type="checkbox">
<span></span>
</label>
You can check custom checkbox in different-different states below snippet
/* Base for label styling */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
[type="checkbox"]:not(:checked) + label,
[type="checkbox"]:checked + label {
position: relative;
padding-left: 1.95em;
cursor: pointer;
}
/* checkbox aspect */
[type="checkbox"]:not(:checked) + label:before,
[type="checkbox"]:checked + label:before {
content: '';
position: absolute;
left: 0; top: 0;
width: 1.25em; height: 1.25em;
border: 2px solid #ccc;
background: #fff;
border-radius: 4px;
box-shadow: inset 0 1px 3px rgba(0,0,0,.1);
}
/* checked mark aspect */
[type="checkbox"]:not(:checked) + label:after,
[type="checkbox"]:checked + label:after {
content: '✔';
position: absolute;
top: .1em; left: .3em;
font-size: 1.3em;
line-height: 0.8;
color: #09ad7e;
transition: all .2s;
}
/* checked mark aspect changes */
[type="checkbox"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
[type="checkbox"]:checked + label:after {
opacity: 1;
transform: scale(1);
}
/* disabled checkbox */
[type="checkbox"]:disabled:not(:checked) + label:before,
[type="checkbox"]:disabled:checked + label:before {
box-shadow: none;
border-color: #bbb;
background-color: #ddd;
}
[type="checkbox"]:disabled:checked + label:after {
color: #999;
}
[type="checkbox"]:disabled + label {
color: #aaa;
}
/* accessibility */
[type="checkbox"]:checked:focus + label:before,
[type="checkbox"]:not(:checked):focus + label:before {
border: 2px dotted blue;
}
/* hover style just for information */
label:hover:before {
border: 2px solid #4778d9!important;
}
<p>
<input type="checkbox" id="test1" />
<label for="test1">Red</label>
</p>
<p>
<input type="checkbox" id="test2" checked="checked" />
<label for="test2">Yellow</label>
</p>
<p>
<input type="checkbox" id="test3" checked="checked" disabled="disabled" />
<label for="test3">Green</label>
</p>
<p>
<input type="checkbox" id="test4" disabled="disabled" />
<label for="test4">Brown</label>
</p>

CSS - Styling individual radio buttons

I am trying to style individual radio buttons so that each selection comes out as a different color. However, my code only allows a minimum of two buttons of the same color before the addition of a third. Is there any work around? Here is the non-working code.
<html>
<style>
label {
display: inline-block;
cursor: pointer;
position: relative;
padding-left: 25px;
margin-right: 15px;
font-size: 13px;
}
input[type=radio] {
display: none;
}
label:before {
content: "";
display: inline-block;
width: 20px;
height: 19px;
margin-right: 15px;
position: absolute;
left: 0;
bottombottom: 1px;
background-color: #FFFFFF;
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .3), 0px 1px 0px 0px rgba(255, 255, 255, .8);
}
label:before {
border-radius: 8px;
}
.radio1 input[type=radio]:checked + label:before {
content: "\2022";
color: #73abfb;
font-size: 55px;
text-align: center;
line-height: 22px;
}
.radio2 input[type=radio]:checked + label:before {
content: "\2022";
color: #f8982d;
font-size: 55px;
text-align: center;
line-height: 22px;
}
.radio3 input[type=radio]:checked + label:before {
content: "\2022";
color: #9cc537;
font-size: 55px;
text-align: center;
line-height: 22px;
}
</style>
<div class="radio1">
<input id="w" type="radio" name="INTAKE" value="w">
<label for="w"></label></div>
<div class="radio2">
<input id="p" type="radio" name="INTAKE" value="P">
<label for="p"></label></div>
<div class="radio3">
<input id="c" type="radio" name="INTAKE" value="C">
<label for="c"></label></div>
</html>
You can set color in radio with class .radio3 like following:
label {
display: inline-block;
cursor: pointer;
position: relative;
padding-left: 25px;
margin-right: 15px;
font-size: 13px;
}
input[type=radio] {
display: none;
}
label:before {
content: "";
display: inline-block;
width: 20px;
height: 19px;
margin-right: 15px;
position: absolute;
left: 0;
bottom: 1px;
background-color: #FFFFFF;
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .3), 0px 1px 0px 0px rgba(255, 255, 255, .8);
}
label:before {
border-radius: 8px;
}
.radio1 input[type=radio]:checked + label:before {
content: "\2022";
color: #73abfb;
font-size: 55px;
text-align: center;
line-height: 22px;
}
.radio2 input[type=radio]:checked + label:before {
content: "\2022";
color: #f8982d;
font-size: 55px;
text-align: center;
line-height: 22px;
}
.radio3 input[type=radio]:checked + label:before {
content: "\2022";
color: red;/*here change color*/
font-size: 55px;
text-align: center;
line-height: 22px;
}
<div class="radio1">
<input id="w" type="radio" name="INTAKE" value="w">
<label for="w"></label>
</div>
<div class="radio2">
<input id="p" type="radio" name="INTAKE" value="P">
<label for="p"></label>
</div>
<div class="radio3">
<input id="c" type="radio" name="INTAKE" value="C">
<label for="c"></label>
</div>
Also you have to read css. I assume you take copy-paste this code from internet.