0

I'm using jQueryUI checkboxes without icon but cannot find how to modify/override the checkbox style using CSS.

For example I'd like to add a red border on "checked" buttons, but the following CSS doesn't work (I deduced the classes from the DevTools Elements pane):

.ui-checkboxradio-label .ui-corner-all .ui-button .ui-widget .ui-checkboxradio-checked .ui-state-active {
    border: 2px solid rgb(255,0,0) !important;
}

.checkbox-noicon .ui-checkboxradio .ui-helper-hidden-accessible {
    border: 2px solid rgb(255,0,0) !important;
}

I also tried modifying the style of the input's "checked" state directly, also with no effect:

input[type=checkbox]:checked {
    border: 2px solid rgb(255,0,0) !important;
}

Am I doing something wrong?

1
  • First solution.. I think too much spaces. if that classes from one element it shout be without spaces. for example .ui-checkboxradio-checked.ui-state-active Second solution should work after hard refresh (ctrl + f5 or ctrl + shit+ r for chrome) Commented Oct 26, 2017 at 13:57

1 Answer 1

3

I cheked example link. All classes in one element, so it shoud be like that(without spaces):

.ui-checkboxradio-label.ui-corner-all.ui-button.ui-widget.ui-checkboxradio-checked.ui-state-active{
     border: 2px solid rgb(255,0,0) !important; 
}

and don't forget hard refresh

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for catching this! It was indeed the spacing preventing the class to be applied, even the !important was redundant after this. I usually disable cache during development in Chrome to avoid related issues.

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.