Search
 
SCRIPT & CODE EXAMPLE
 

CSS

change the color of a checkbox css

input[type="checkbox"] {
  accent-color: red;
}
Comment

checkbox background color css

input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* Styling checkbox */
  width: 16px;
  height: 16px;
  background-color: green;
}

input[type="checkbox"]:checked {
  background-color: blue;
}

<input type="checkbox" />
Comment

css checkbox':checked change color

<label for="checkbox1" class="checkbox">
  <input id="checkbox1" type="checkbox" role="checkbox" />
  <span class="custom">Checkbox</span>
</label>


input[type="checkbox"]#checkbox1:checked + span {
      border-color: red;
    background-color:red;
}
Comment

customize css checkbox checked color

<!DOCTYPE html>
<html>
<head>
	<style>
		.main {
			display: block;
			position: relative;
			padding-left: 45px;
			margin-bottom: 15px;
			cursor: pointer;
			font-size: 20px;
		}
		
		/* Hide the default checkbox */
		input[type=checkbox] {
			visibility: hidden;
		}
		
		/* Creating a custom checkbox
		based on demand */
		.geekmark {
			position: absolute;
			top: 0;
			left: 0;
			height: 25px;
			width: 25px;
			background-color: black;
		}
		
		/* Specify the background color to be
		shown when hovering over checkbox */
		.main:hover input ~ .geekmark {
			background-color: yellow;
		}
		
		/* Specify the background color to be
		shown when checkbox is active */
		.main input:active ~ .geekmark {
			background-color: red;
		}
		
		/* Specify the background color to be
		shown when checkbox is checked */
		.main input:checked ~ .geekmark {
			background-color: green;
		}
		
		/* Checkmark to be shown in checkbox */
		/* It is not be shown when not checked */
		.geekmark:after {
			content: "";
			position: absolute;
			display: none;
		}
		
		/* Display checkmark when checked */
		.main input:checked ~ .geekmark:after {
			display: block;
		}
		
		/* Styling the checkmark using webkit */
		/* Rotated the rectangle by 45 degree and
		showing only two border to make it look
		like a tickmark */
		.main .geekmark:after {
			left: 8px;
			bottom: 5px;
			width: 6px;
			height: 12px;
			border: solid white;
			border-width: 0 4px 4px 0;
			-webkit-transform: rotate(45deg);
			-ms-transform: rotate(45deg);
			transform: rotate(45deg);
		}
	</style>
</head>

<body>
	
	<h1 style="color:green;">
		Best Computer Science Platform
	</h1>
	
	<label class="main">CodeX
		<input type="checkbox">
		<span class="geekmark"></span>
	</label>
	
	<label class="main">GeeksforGeeks
		<input type="checkbox" checked="checked">
		<span class="geekmark"></span>
	</label>
	
	<label class="main">CodeY
		<input type="checkbox">
		<span class="geekmark"></span>
	</label>
</body>
</html>					
Comment

checkbox checked color change css

//HTML example
<label for="checkbox-one" >
  <input id="checkbox-one" type="checkbox" role="checkbox" /><p>Text</p>
</label>


//CSS solution
input[type="checkbox"]#checkbox-one:checked + p {
       color: blue; 
}
Comment

checkbox background color change css

<div class="chek-box">
  <input type="checkbox" />
  <label class="wpforms-field-label-inline">Agree privacy</label>
</div>

<style>
.chek-box li.choice-1.depth-1 {
    position: relative;
}
.chek-box label.wpforms-field-label-inline:after {
    content: '';
    width: 18px;
    height: 18px;
    background: transparent;
    position: absolute;
    display: inline-block;
    left: 0px;
    top: 2px;
    z-index: -1;
    opacity: 1;
    border: 1px solid red;
}
.chek-box input[type="checkbox"] {
    opacity: 0;
}
.chek-box input[type="checkbox"]:checked ~ label.wpforms-field-label-inline:after {
  background: red;
}
.chek-box input[type="checkbox"]:checked ~ label.wpforms-field-label-inline:before {
  opacity: 1;
}
label.wpforms-field-label-inline:before {
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    content: '';
    z-index: 9999999;
    position: absolute;
    display: inline-block;
    left: 6px;
    top: 4px;
opacity: 0;
}
</style>


<!-- M.Sajjad Rogi -->
<!-- Web Designer & Developer -->
<!-- +92 302 2020 318 -->
<!-- msrogi6@gmailcom -->
Comment

PREVIOUS NEXT
Code Example
Css :: css image fit in div with aspect ratio 
Css :: remove scrollbar css 
Css :: E/ViewRootImpl: sendUserActionEvent() mView returned. 
Css :: hover none in css 
Css :: ionic textarea placeholder color 
Css :: soft box shadow css 
Css :: css keep background image from scrolling 
Css :: glowing text css 
Css :: bootstrap col no gaps 
Css :: remove underline on hover span 
Css :: excel arabic numbers 
Css :: css text transform 
Css :: text border css 
Css :: smooth transition in and out css 
Css :: Bootstap 5.2.0 cdn 
Css :: slide up and down animation css 
Css :: css text limit 
Css :: how to create a glass-polymorphism effect 
Css :: position relative get in center 
Css :: opacity animation css 
Css :: box shadow to make border bottom 
Css :: tablet screen media query 
Css :: css text justify 
Css :: align ionic icons and text css 
Css :: how to center a div vertically and horizontally 
Css :: rust get current date 
Css :: ovale css 
Css :: Set table cellpadding and cellspacing in CSS 
Css :: ionchips scroll x 
Css :: animation-direction property 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =