I have an awesome font span that's functioning as my menu arrow. When the text doesn't fully cover the container the arrow floats fine off to the right, but if the text fits just right the arrow gets pushed out.
The arrow icon sits within the label, and the label sits within a nav. The arrow is not the button. The button is a checkbox hidden that also sits within the label.
nav.tag {
background: #cdcdcd;
width: 100%;
line-height: 40px;
padding: 5px 0px 5px;
border-radius: 5px 5px 5px 5px;
-webkit-touch-callout: none;
/* iOS Safari */
-webkit-user-select: none;
/* Safari */
-khtml-user-select: none;
/* Konqueror HTML */
-moz-user-select: none;
/* Old versions of Firefox */
-ms-user-select: none;
/* Internet Explorer/Edge */
user-select: none;
margin-bottom: 5px;
margin-top: 30px;
}
label.button {
line-height: 130%
}
.button {
padding-left: 20px;
}
input[type='checkbox'] {
display: none;
}
nav label {
font-size: 20px;
display: block;
cursor: pointer;
}
.button span {
float: right;
line-height: 130%;
margin-right: 20px;
margin-top: 0px;
}
nav ul label:nth-child(1) {
font-weight: bold;
font-size: 20px;
}
nav.tag ul {
background: rgb(221, 221, 221);
list-style: none;
width: 100%;
border-radius: 0px 0px 5px 5px;
padding-bottom: 5px;
display: none;
}
.bold-me {
transition: 30ms;
}
.highlight {
font-weight: bold;
color: #005DA4;
font-size: 21px;
}
[id^=btn]:checked+ul {
display: block;
}
nav.tag ul li {
line-height: 40px;
padding 8px 20px;
cursor: pointer;
margin-top: 10px;
}
nav.tag ul li:nth-child(5) {
margin-top: 0px;
}
.divider {
width: 80%;
height: 2px;
background-color: #BBBBBB;
}
.course-title {
font-size: 24px;
}
.people {
border: solid 1px #BBBBBB;
height: 32px;
width: 50px;
padding: 0px 0px 0px 20px;
font-size: 17px;
outline: none;
border: none;
transition: 100ms;
border-radius: 5px;
transform: translateY(-1.5px);
}
.people:focus {
box-shadow: 0 0 3pt 1pt cornflowerblue;
}
.radio {
display: inline-flex;
align-items: center;
cursor: pointer;
margin-right: 10px;
}
.radio__input {
display: none;
}
.radio__radio {
width: 25px;
height: 25px;
border: 3px solid rgb(103, 103, 103);
border-radius: 50%;
margin-right: 10px;
box-sizing: border-box;
padding: 2px;
transition: 150ms;
background: #f4f4f4
}
.a,
.b {
border: none;
border-radius: 5px;
font-size: 23px;
font-weight: lighter;
width: 30px;
outline: none;
cursor: pointer;
transition: 120ms;
}
.a {
padding-bottom: 2px;
}
.a:active,
.b:active {
background-color: #3382BE;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
}
.radio__radio:hover {
box-shadow: 0 0 3pt 1pt cornflowerblue;
}
.radio__radio::after {
content: "";
width: 100%;
height: 100%;
display: block;
background: #3382BE;
border-radius: 50%;
transform: scale(0);
transition: transform 150ms;
}
.radio__input:checked+.radio__radio::after {
transform: scale(1);
}
.remove-course {
border: none;
background-color: transparent;
cursor: pointer;
color: #535353;
font-size: 17px;
font-weight: bold;
border-radius: 5px;
transition: 150ms;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
text-decoration: underline;
outline: none;
}
.remove-course:hover {
color: #3382BE;
outline: none;
}
#btn {
display: none;
}
.arrow {
transition: 250ms ease-out;
}
.rotate {}
.button span.rotate {
transform: rotate(-180deg);
}
.fa-user {
margin-right: 10px;
font-size: 24px;
transform: translateY(3px);
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<nav class="tag">
<label for="'+btn+'" class="button bold-me" onclick="rotate()">'+course_name+'<span class="fas fa-caret-down arrow"></span> </label><input type="checkbox" id="'+btn+'">
<ul class="menu">
<li>
<label for="" class="title course">Express Program Preference:</label>
<label for="radio1" class="radio">
<input type="radio" name="express-radio" id="radio1" class="radio__input">
<div class="radio__radio"></div>
A Must
</label>
<label for="radio2" class="radio">
<input type="radio" name="express-radio" id="radio2" class="radio__input">
<div class="radio__radio"></div>
Would Like
</label>
<label for="radio3" class="radio">
<input type="radio" name="express-radio" id="radio3" class="radio__input" checked>
<div class="radio__radio"></div>
No Preference
</label>
</li>
<li>
<div class="divider"></div>
</li>
<li> <label for="" class="course-title">Expected Party Size:</label> <i class="fas fa-user"></i><input type="number" name="" value="1" min="1" class="people" id="total"> <button onclick="minus()" class="a">-</button> <button onclick="add()" class="b">+</button> </li>
<li>
<div class="divider"></div>
</li>
<li> <button onclick="tagDelete(event)" class="remove-course">Remove Course</button> </li>
</ul>
</nav>
This is one of those rare cases where absolute positioning is useful.
label.button {
position: relative; /* <-- causes the label to act as a container */
padding-right: 20px;
}
.fa-caret-down {
position: absolute;
right: 0;
bottom: 0;
}
nav.tag {
background: #cdcdcd;
width: 100%;
line-height: 40px;
padding: 5px 0px 5px;
border-radius: 5px 5px 5px 5px;
-webkit-touch-callout: none;
/* iOS Safari */
-webkit-user-select: none;
/* Safari */
-khtml-user-select: none;
/* Konqueror HTML */
-moz-user-select: none;
/* Old versions of Firefox */
-ms-user-select: none;
/* Internet Explorer/Edge */
user-select: none;
margin-bottom: 5px;
margin-top: 30px;
}
label.button {
line-height: 130%
}
.button {
padding-left: 20px;
}
input[type='checkbox'] {
display: none;
}
nav label {
font-size: 20px;
display: block;
cursor: pointer;
}
.button span {
float: right;
line-height: 130%;
margin-right: 20px;
margin-top: 0px;
}
nav ul label:nth-child(1) {
font-weight: bold;
font-size: 20px;
}
nav.tag ul {
background: rgb(221, 221, 221);
list-style: none;
width: 100%;
border-radius: 0px 0px 5px 5px;
padding-bottom: 5px;
display: none;
}
.bold-me {
transition: 30ms;
}
.highlight {
font-weight: bold;
color: #005DA4;
font-size: 21px;
}
[id^=btn]:checked+ul {
display: block;
}
nav.tag ul li {
line-height: 40px;
padding 8px 20px;
cursor: pointer;
margin-top: 10px;
}
nav.tag ul li:nth-child(5) {
margin-top: 0px;
}
.divider {
width: 80%;
height: 2px;
background-color: #BBBBBB;
}
.course-title {
font-size: 24px;
}
.people {
border: solid 1px #BBBBBB;
height: 32px;
width: 50px;
padding: 0px 0px 0px 20px;
font-size: 17px;
outline: none;
border: none;
transition: 100ms;
border-radius: 5px;
transform: translateY(-1.5px);
}
.people:focus {
box-shadow: 0 0 3pt 1pt cornflowerblue;
}
.radio {
display: inline-flex;
align-items: center;
cursor: pointer;
margin-right: 10px;
}
.radio__input {
display: none;
}
.radio__radio {
width: 25px;
height: 25px;
border: 3px solid rgb(103, 103, 103);
border-radius: 50%;
margin-right: 10px;
box-sizing: border-box;
padding: 2px;
transition: 150ms;
background: #f4f4f4
}
.a,
.b {
border: none;
border-radius: 5px;
font-size: 23px;
font-weight: lighter;
width: 30px;
outline: none;
cursor: pointer;
transition: 120ms;
}
.a {
padding-bottom: 2px;
}
.a:active,
.b:active {
background-color: #3382BE;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
}
.radio__radio:hover {
box-shadow: 0 0 3pt 1pt cornflowerblue;
}
.radio__radio::after {
content: "";
width: 100%;
height: 100%;
display: block;
background: #3382BE;
border-radius: 50%;
transform: scale(0);
transition: transform 150ms;
}
.radio__input:checked+.radio__radio::after {
transform: scale(1);
}
.remove-course {
border: none;
background-color: transparent;
cursor: pointer;
color: #535353;
font-size: 17px;
font-weight: bold;
border-radius: 5px;
transition: 150ms;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
text-decoration: underline;
outline: none;
}
.remove-course:hover {
color: #3382BE;
outline: none;
}
#btn {
display: none;
}
.arrow {
transition: 250ms ease-out;
}
.rotate {}
.button span.rotate {
transform: rotate(-180deg);
}
.fa-user {
margin-right: 10px;
font-size: 24px;
transform: translateY(3px);
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<nav class="tag">
<label for="'+btn+'" class="button bold-me" onclick="rotate()">A very long course name that's very long with many really long words that goes on and on for quite some time - it's actually rather crazy how long the label is, and someone should really look into it<span class="fas fa-caret-down arrow"></span> </label><input type="checkbox" id="'+btn+'">
<ul class="menu">
<li>
<label for="" class="title course">Express Program Preference:</label>
<label for="radio1" class="radio">
<input type="radio" name="express-radio" id="radio1" class="radio__input">
<div class="radio__radio"></div>
A Must
</label>
<label for="radio2" class="radio">
<input type="radio" name="express-radio" id="radio2" class="radio__input">
<div class="radio__radio"></div>
Would Like
</label>
<label for="radio3" class="radio">
<input type="radio" name="express-radio" id="radio3" class="radio__input" checked>
<div class="radio__radio"></div>
No Preference
</label>
</li>
<li>
<div class="divider"></div>
</li>
<li> <label for="" class="course-title">Expected Party Size:</label> <i class="fas fa-user"></i><input type="number" name="" value="1" min="1" class="people" id="total"> <button onclick="minus()" class="a">-</button> <button onclick="add()" class="b">+</button> </li>
<li>
<div class="divider"></div>
</li>
<li> <button onclick="tagDelete(event)" class="remove-course">Remove Course</button> </li>
</ul>
</nav>
I know this question have been answered before, but none of the answers are working for me, so I need help with whatever I'm doing wrong. I want my checkbox to have a green background color and white check mark once it has been clicked. I've added my code below, and in the codepen link you can view a little more detail.
Codepen link: --> https://codepen.io/paulamourad/pen/oPpbEm
/* Customize the label (the container) */
.form-check {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 0.9em;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Hide the browser's default checkbox */
.form-check input {
position: absolute;
opacity: 0;
cursor: pointer;
}
/* Create a custom checkbox */
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 20px;
width: 20px;
border: 2px solid #D6D4D4;
}
/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
content: "";
position: absolute;
display: none;
}
/* Show the checkmark when checked */
.form-check input:checked~.checkmark:after {
display: block;
}
/* Style the checkmark/indicator */
.form-check .checkmark:after {
left: 2px;
top: 3px;
width: 5px;
height: 10px;
border: solid #8ABE57;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
<label class="form-check">
<input class="form-check-input" type="checkbox" value="" id="checkPeriodDays">
<span class="checkmark"></span>
<label class="form-check-label ml-2" for="checkPeriodDays">
Días
</label>
</label>
.container {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.container input {
position: absolute;
opacity: 0;
cursor: pointer;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #eee;
}
.container:hover input ~ .checkmark {
background-color: green;
}
.container input:checked ~ .checkmark {
background-color: green;
}
.checkmark:after {
content: "";
position: absolute;
display: none;
}
.container input:checked ~ .checkmark:after {
display: block;
}
.container .checkmark:after {
left: 9px;
top: 5px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Checkbox Test</title>
</head>
<body>
<label class="container">Dias One
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
<label class="container">Dias Two
<input type="checkbox">
<span class="checkmark"></span>
</label>
<label class="container">Dias Three
<input type="checkbox">
<span class="checkmark"></span>
</label>
</body>
</html>
I am trying to launch a Web UI using Flask, however, the radio buttons and check boxes aren't showing. I've tried following online examples, like the ones here: https://www.w3schools.com/bootstrap/bootstrap_forms_inputs.asp
The CSS file has a lot of sections pertaining to checkboxes/radios, but I'm not sure which part is the source of the problem (if that).
Here is the relevant portion of the CSS file:
/* Form */
form {
margin: 0 0 2em 0;
}
label {
display: block;
font-size: 0.9em;
font-weight: 400;
margin: 0 0 1em 0;
}
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
-moz-appearance: none;
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
border-radius: 4px;
border: none;
border: solid 1px;
color: inherit;
display: block;
outline: 0;
padding: 0 1em;
text-decoration: none;
width: 100%;
}
input[type="text"]:invalid,
input[type="password"]:invalid,
input[type="email"]:invalid,
select:invalid,
textarea:invalid {
box-shadow: none;
}
.select-wrapper {
text-decoration: none;
display: block;
position: relative;
}
.select-wrapper:before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-transform: none !important;
}
.select-wrapper:before {
content: '\f078';
display: block;
height: 2.75em;
line-height: 2.75em;
pointer-events: none;
position: absolute;
right: 0;
text-align: center;
top: 0;
width: 2.75em;
}
.select-wrapper select::-ms-expand {
display: none;
}
input[type="text"],
input[type="password"],
input[type="email"],
select {
height: 2.75em;
}
textarea {
padding: 0.75em 1em;
}
input[type="checkbox"],
input[type="radio"] {
-moz-appearance: none;
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
display: block;
float: left;
margin-right: -2em;
opacity: 0;
width: 1em;
z-index: -1;
}
input[type="checkbox"]+label,
input[type="radio"]+label {
text-decoration: none;
cursor: pointer;
display: inline-block;
font-size: 1em;
font-weight: 200;
padding-left: 2.4em;
padding-right: 0.75em;
position: relative;
}
input[type="checkbox"]+label:before,
input[type="radio"]+label:before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-transform: none !important;
}
input[type="checkbox"]+label:before,
input[type="radio"]+label:before {
border-radius: 4px;
border: solid 1px;
content: '';
display: inline-block;
height: 1.65em;
left: 0;
line-height: 1.58125em;
position: absolute;
text-align: center;
top: 0;
width: 1.65em;
}
input[type="checkbox"]:checked+label:before,
input[type="radio"]:checked+label:before {
content: '\f00c';
}
input[type="checkbox"]+label:before {
border-radius: 4px;
}
input[type="radio"]+label:before {
border-radius: 100%;
}
::-webkit-input-placeholder {
opacity: 1.0;
}
:-moz-placeholder {
opacity: 1.0;
}
::-moz-placeholder {
opacity: 1.0;
}
:-ms-input-placeholder {
opacity: 1.0;
}
.formerize-placeholder {
opacity: 1.0;
}
label {
color: #444444;
}
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
background: rgba(144, 144, 144, 0.075);
border-color: #666666;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
border-color: #EF6480;
box-shadow: 0 0 0 1px #EF6480;
}
.select-wrapper:before {
color: #666666;
}
input[type="checkbox"]+label,
input[type="radio"]+label {
color: #666666;
}
input[type="checkbox"]+label:before,
input[type="radio"]+label:before {
background: rgba(144, 144, 144, 0.075);
border-color: #666666;
}
input[type="checkbox"]:checked+label:before,
input[type="radio"]:checked+label:before {
background-color: #EF6480;
border-color: #EF6480;
color: #ffffff;
}
input[type="checkbox"]:focus+label:before,
input[type="radio"]:focus+label:before {
border-color: #EF6480;
box-shadow: 0 0 0 1px #EF6480;
}
::-webkit-input-placeholder {
color: #999999 !important;
}
:-moz-placeholder {
color: #999999 !important;
}
::-moz-placeholder {
color: #999999 !important;
}
:-ms-input-placeholder {
color: #999999 !important;
}
.formerize-placeholder {
color: #999999 !important;
}
Here is the relevant portion of the HTML file:
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Wrapper -->
<div id="wrapper">
<!-- Banner -->
<section id="intro" class="main">
<span class="icon fa-diamond major"></span>
<h3>Please upload your authors list below</h3>
<form action="" method=post enctype=multipart/form-data>
<p><input type=file name=file>
<br><br>
<input type="checkbox" name="sep1" value="Separate initials with period"> Separate initials with period<br>
<input type="checkbox" name="sep2" value="Separate initials with space"> Separate initials with space<br>
<input type="radio" name="affiliation" value="Mark affiliations with letter"> Mark affiliations with letter
<input type="radio" name="affiliation" value="Mark affiliations with number" checked> Mark affiliations with number<br><br>
<input type=submit value=Upload></p>
</form>
</section>
</div>
You can Simplify your CSS from :
input[type="checkbox"], input[type="radio"] {
-moz-appearance: none;
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
display: block;
float: left;
margin-right: -2em;
opacity: 0;
width: 1em;
z-index: -1;
}
Into This 1
input[type="checkbox"], input[type="radio"] {
width: 1em;
z-index: -1;
}
Or You can just Delete that part of your CSS
Here is the problematic section of your css:
input[type="checkbox"],
input[type="radio"] {
-moz-appearance: none;
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
display: block;
float: left;
margin-right: -2em;
opacity: 0;
width: 1em;
z-index: -1;
}
Change opacity to 1
Get rid of the appearance none.
There are other problems with your code but this solves your question about the boxes not appearing.
This should get you closer to what you are looking for:
input[type="checkbox"],
input[type="radio"] {
display: inline-block;
opacity: 1;
width: 1em;
z-index: -1;
}
It can happen because of multiple reasons, however
opacity: 1;
is one of the crucial things if your checkbox is not visible. Secondly, your position should not be absolute, it should be like
position: relative;
Just in case you are not able to click/check your checkbox, it's because you have blocked pointer-events. So change it to
pointer-events: all;
In all, your CSS code will look like this,
input[type="checkbox"]{
width: 1em;
position: relative;
opacity: 1;
pointer-events: all;
}
Note: In case if you still fail to achieve the desired result, try this code
input[type="checkbox"]{
width: 1em;
position: relative !important;
opacity: 1 !important;
pointer-events: all !important;
}
<input type='checkbox' name='chkbox'/>
I want to change the checkbox height and width and also background color if possible
You can look at this piece of code for starters.
It uses the before element to create a custom shape and hide the default checkbox for two states 'checked' and 'unchecked'
Also give a label for that corresponding checkbox so that clicking this custom shape will actually trigger the hidden default checkbox.
body {
font-family: 'segoe ui';
background-color: white;
padding: 10px;
}
.space {
height: 10px;
}
.checkbox * {
box-sizing: border-box;
position: relative;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.checkbox {
display: inline-block;
}
.checkbox>input {
display: none;
}
.checkbox>label {
vertical-align: top;
font-size: 18px;
padding-left: 30px;
}
.checkbox>[type="checkbox"]+label:before {
color: #777;
content: '';
position: absolute;
left: 0px;
display: inline-block;
min-height: 20px;
height: 20px;
width: 20px;
border: 2px solid #777;
font-size: 15px;
vertical-align: top;
text-align: center;
transition: all 0.2s ease-in;
content: '';
}
.checkbox.radio-square>[type="checkbox"]+label:before {
border-radius: 0px;
}
.checkbox.radio-rounded>[type="checkbox"]+label:before {
border-radius: 25%;
}
.checkbox.radio-blue>[type="checkbox"]+label:before {
border: 2px solid #ccc;
}
.checkbox>[type="checkbox"]+label:hover:before {
border-color: lightgreen;
}
.checkbox>[type="checkbox"]:checked+label:before {
width: 8px;
height: 16px;
border-top: transparent;
border-left: transparent;
border-color: green;
border-width: 4px;
transform: rotate(45deg);
top: -4px;
left: 4px;
}
<div class="checkbox">
<input id="chkTest" type="checkbox" />
<label for="chkTest">Task one</label>
<div class="space">
</div>
<input id="chkTest1" type="checkbox" />
<label for="chkTest1">Task two</label>
</div>
i'm trying to personalize the appearance of Checkbox but this only works in Google Chrome for mozilla doesn't work i dont know how to fix this here is my code:
Example:
Checkbox on jsfiddle.net
¡Please! before you post any response see example in the 2 browsers in
this case Chrome and Mozilla.
images from google chrome and mozilla
Chrome:
Mozilla
CSS:
#div-tallas .seleccion-talla .btn-default{
padding: 6px 7px;
font-weight: 600;
font-size: 1.2em;
letter-spacing: 0px;
min-width: 40px;
margin-left: 1px !important;
}
#div-tallas input[type="checkbox"] {
/* 1 */
display: inline-block;
height: 36px;
width: 36px;
border: 2px solid #000;
-moz-border: 2px solid #000;
/* 2 */
overflow: hidden;
/* 3 */
margin-top: -4px;
vertical-align: middle;
/* 4 */
-webkit-appearance: none;
-moz-appearance: none;
outline: 0;
/* 5 */
background: #e5e4e4;
-moz-background: #e5e4e4;
}
/*
* Checked
*/
#div-tallas input[type=checkbox]:checked {
/* 1 */
display: inline-block;
height: 36px;
width: 36px;
border: 2px solid #e5e4e4 !important;
-moz-border: 2px solid #e5e4e4 !important;
/* 2 */
overflow: hidden;
/* 3 */
margin-top: -4px;
vertical-align: middle;
/* 4 */
-webkit-appearance: none;
-moz-appearance: none;
outline: 0;
/* 5 */
background: #ff6500 !important;
background-color: #ff6500 !important;
padding: 2px;
transition: background 0.4s linear 0s, color 0.4s linear 0s;
}
/* Checkbox */
#div-tallas input[type=checkbox]:checked:before,
#div-tallas input[type=checkbox]:indeterminate:before {
content: "\f00c";
font-family: FontAwesome;
font-size: 32px;
-webkit-font-smoothing: antialiased;
text-align: center;
line-height: 26px;
color: #e5e4e4;
z-index: 888;
margin-left: -1px;
}
#div-tallas input[type=checkbox]:indeterminate:before {
content: "\f068";
}
How about styling the label?
#div-tallas {
background-color: #e5e4e4 !important;
min-height: 40vh;
}
#div-tallas input[type="checkbox"] {
display: none;
}
#div-tallas input[type="checkbox"] + label {
padding-left: 0;
}
#div-tallas input[type="checkbox"] + label:before {
/* 1 */
font: 32px/32px 'FontAwesome';
text-align: center;
display: inline-block;
height: 36px;
width: 36px;
border: 2px solid #000;
overflow: hidden;
margin-top: -4px;
vertical-align: middle;
background: transparent;
/* to show content */
content: "\00a0";
margin-right: 8px;
}
/*
* Checked
*/
#div-tallas input[type=checkbox]:checked + label:before {
border: 2px solid transparent;
background: #ff6500;
transition: background 0.4s linear 0s, color 0.4s linear 0s;
}
/* Checkbox */
#div-tallas input[type=checkbox]:checked + label:before,
#div-tallas input[type=checkbox]:indeterminate + label:before {
content: "\f00c";
color: #e5e4e4;
}
#div-tallas input[type=checkbox]:indeterminate + label:before {
content: "\f068";
}
jsfiddle
This isn't 100% perfect but it does show you a working example of a pure CSS checkbox that works in both Chrome and Firefox.
JSFiddle
HTML
<div id="div-tallas">
<div class="quiero-este">
<h5>¡Quiero este!</h5>
<div class="checkbox check-primary m-top-40 text-center">
<input type="checkbox" value="1" id="checkbox1" />
<label for="checkbox1"></label>
</div>
</div>
</div>
CSS
#div-tallas {
background-color: #e5e4e4 !important;
min-height: 40vh;
}
#div-tallas input[type=checkbox] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: transparent;
visibility: hidden;
}
#div-tallas input[type=checkbox],
#div-tallas input[type=checkbox] + label::before {
cursor: pointer;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
#div-tallas input[type=checkbox] + label::before {
content: '';
text-align: center;
background: #e5e4e4;
display: inline-block;
pointer-events: none;
opacity: 1;
color: black;
border: 3px solid black;
width: 36px;
height: 36px;
}
#div-tallas input[type=checkbox] + label {
line-height: 20px;
margin: 0 15px 0 15px;
}
#div-tallas input[type=checkbox]:hover {
cursor: pointer;
}
#div-tallas input[type=checkbox]:hover + label::before {
content: '';
background: #e5e4e4;
}
#div-tallas input[type=checkbox]:checked + label::before {
background: #ff6500 !important;
background-color: #ff6500 !important;
outline: 0;
content: "\f00c";
font-family: FontAwesome;
font-size: 32px;
-webkit-font-smoothing: antialiased;
text-align: center;
line-height: 26px;
color: #e5e4e4;
z-index: 888;
margin-left: -1px;
}
#div-tallas input[type=checkbox]:checked:hover + label::before {
opacity: 1;
}
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
Hope this helps.