Background Color of Selected Row
Background Color of Selected Row
Currently background-color of selected row is default to #acbad4. Although you can use css to set the color of selected row, you cannot do the same for background-color. Is it true? Is there any way to do it?
tbody tr.selected {
color: white;
background-color: #eeeeee; /* Not working */
}
Thanks!
This question has accepted answers - jump to:
This discussion has been closed.
Answers
css overruling should work. Make sure your custom css file is loaded last.
Try using this css:
Hi F12Magic,
OK, I understand the loading order logic now. But how do I do it? Currently, I have the custom css rules in the <head> section of the HTML of the index file, AFTER loading other css files. Do I miss something?
But it is still over-ruled by datatable.min.css.
Seems like a duplicate of your other thread. Please don't post duplicates.
It is still overruled because the DataTables selector is more specific.
Allan
See the [MDN documentation](https://developer.mozilla.org/en/docs/Web/CSS/Specificity on CSS Specificity).
Allan
Following @allan specificity's link. You'll have 2 options to overrule the style.
Use your table ID if you now it:
Or use the important exeption: