Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add highlight on clickable table row (using bootstrap) - CSS

I want to highlight row on mouseover (hover). I am using bootstrap and on the table I use their class table-striped , so when I write css:

tbody {
  tr:hover {
    background-color: #ff0;
  }
}

It only changes color on rows that are white, but not the other ones. Not sure what the best way to solve this problem is. Maybe I can overwrite table-striped highlighting somehow? How would I do that?

like image 250
Chemist Avatar asked Nov 13 '13 21:11

Chemist


1 Answers

Try using the 'table-hover' and override the color like this..

.table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th {
  background-color: #550055;
  color:#eeeeee;
}

http://bootply.com/93988

like image 200
Zim Avatar answered Nov 11 '22 08:11

Zim