I'm trying to narrow the handle on the jQuery UI slider widget. I created this CSS:
.ui-slider-handle {
width: 10px;
}
Which the DOM inspector tells me is being ignored in favor of the jQuery UI CSS.
How can I give mine the higher priority? The only way to ID the slider handle, since it's made by a jQuery function (.slider()) and isn't actually in the .html file, is to use code to assign it an ID after having made it with jQuery, and then hoping the CSS applies, or else manually adding the width attribute with code. These seem unelegant.
What's the best way?
!importanttag.!important. It seems to be useful first, but later you find out it poisoned your stylesheets and your life.!importantis more of a last resort for resolving specificity conflicts between rules. It should not be used in the general case. Otherwise it tends to creep in your styles very quickly.!important, it ends up creating more problems down the line!