user2447848
user2447848

Reputation: 289

how do I stop the header of my search results from being highlighted on mouseover

I'm using the following css to highlight my data rows

tr:hover{
background-color:grey;
}

but this highlights the table header as well.

I tried

.notfirst:hover{
background-color:grey;
}

but that prevents anything from highlighting. Is there a simple css fix to this?

Upvotes: 2

Views: 52

Answers (2)

Ayyappan Sekar
Ayyappan Sekar

Reputation: 11475

Try this

tr:not(:first-child):hover {
    //styles here
}

Upvotes: 0

user2568107
user2568107

Reputation:

Use this CSS:

tr:hover:not(:first-child) {
background-color:grey;
}

Upvotes: 3

Related Questions