1

I am having a problem over-riding the bootstrap css for checkboxes and input checkboxes. I have a checkboxlist and the bootstraps styling is over-riding my own css file. I have doubled checked and made sure that it wasn't bootstraps themes causing the issue but it is the bootstraps css.

I have also tried using !important in my css and it still gets over-ridden, I even placed my css file after the bootstraps css, tried putting my css before it, even tried

input[type=checkbox]

and that did nothing as well.

Here is the css I'm trying to use to override the bootstrap

.CheckBoxSubjects td {
border-style: solid;
border: 1px solid #78E389;
width: 122px;
height: 27px;
border-radius: 5px;
background-color:#78E389;
}
1
  • give me css declation code, and Try to using inline CSS Commented Feb 15, 2014 at 5:56

1 Answer 1

2

Here's the fiddle of the code I used. Hope this helps for you.

http://jsfiddle.net/cLaty/

HTML

<div class="checkbox pull-right">
      <input type="checkbox" id="remember" /><label for="remember">Remember me</label>
    </div>

CSS

input[type="checkbox"]:not(:checked),
input[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
input[type="checkbox"]:not(:checked) + label,
input[type="checkbox"]:checked + label {
position: relative;
padding-left: 25px;
cursor: pointer;
}

 /* checkbox aspect */
 input[type="checkbox"]:not(:checked) + label:before,
 input[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 */
 input[type="checkbox"]:not(:checked) + label:after,
 input[type="checkbox"]:checked + label:after {
content: '✔';
position: absolute;
top: 0; left: 4px;
font-size: 14px;
color: #4cc0c1;
transition: all .2s;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
-o-transition: all .2s;
}
/* checked mark aspect changes */
input[type="checkbox"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
input[type="checkbox"]:checked + label:after {
opacity: 1;
transform: scale(1);
}
/* disabled checkbox */
input[type="checkbox"]:disabled:not(:checked) + label:before,
input[type="checkbox"]:disabled:checked + label:before {
box-shadow: none;
border-color: #999999;
background-color: #ddd;
} 
input[type="checkbox"]:disabled:checked + label:after {
color: #999;
}
input[type="checkbox"]:disabled + label {
color: #aaa;
}
 /* accessibility */
 input[type="checkbox"]:checked:focus + label:before,
 input[type="checkbox"]:not(:checked):focus + label:before {
 border: inherit;
}
Sign up to request clarification or add additional context in comments.

2 Comments

That's what I'm trying to get rid of, the bootstrap is making my checkboxlist checkboxes to close together, no separation. When I use the css without bootstrap, the checkboxes are nicely separated. Bootstrap is making them muddled.
This how I am using it. Things are fine for me this way. "<div class="form-group"> <a class="pull-right" href="#">Forgot password?</a> <label for="inputPassword">Password</label> <input type="password" class="form-control" id="inputPassword"> </div> <div class="checkbox pull-right"> <input type="checkbox" id="remember" /><label for="remember">Remember me</label> </div>"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.