Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4623296
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:58:00+00:00 2026-05-22T02:58:00+00:00

I am using a logic to highlight cells based on if the cursor is

  • 0

I am using a logic to highlight cells based on if the cursor is hovering over the row:

function setupTable(tbl) {
    if ($(tbl).find('tbody').size() > 0) {
        $(tbl).find('tbody tr').hover(function () {
            $(this).find('td:gt(0)').addClass('highlight');
        }, function () {
            $(this).find('td:gt(0)').removeClass('highlight');
        }).click(window.onTrClick);

        if ($(tbl).find('tbody tr').size() > 10) {
            setUpPagination(tbl);
        }
    }
}

The style rule is define like the follows:

.gridview .data
{
    background-color: White;
    padding-left: 3px;
    padding-right: 3px;
}

.highlight
{
    background-color: #3169C6;
    color: White;
    cursor: pointer;
}

But on hovering the text goes white. The net effect is as if that row of data is blanked out. I open IE’s developer toolbar. And try to play around.

enter image description here

I try to manipulate the class attribute and find out that

class="data highlight"

does not give the desired effect. But if I did

class="highlight"

it sort of works…

I am trying to understand why this is so? How will the rules be applied if we do

class="data highlight"?


UPDATE:

I want the padding of .data to be sort-of “inherited” (or maintained) to .highlight. What do I do then?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:58:01+00:00Added an answer on May 22, 2026 at 2:58 am

    .gridview .data has higher specificity than .highlight.

    The result is that background-color: White (from .gridview .data, instead of background-color: #3169C6 from .highlight) and color: White (from .highlight) is applied, making it appear to be “blanked out”.

    To fix it, you should change .highlight to .gridview .highlight.

    This fix will work because .gridview .data and .gridview .highlight will then have equal specificity, so it will then come down to which was defined last. That’s .gridview .highlight, so the declarations in there will override those in .gridview .data.

    If you also use the .highlight class in other places, then instead change it to .highlight, .gridview .highlight.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find out whether I should be using business critical logic in
My jsp page display a list using logic iterate. every row displayed has a
I find myself using this logic a lot: if (isset($array[$key])) $array[$key] += $num; else
public MyClass(int someUniqueID) { using(//Session logic) { var databaseVersionOfMyClass = session.CreateCriteria(/*criteria*/) .UniqueResult<MyClass>(); //Load logic
In my matlab m-file I am using some logic (string concat) to build variables
i'm using ECLiPSe programming logic system. i want to implement the yield method for
We are using Linq To SQL with our own data context logic that executes
We are using Linq To SQL with our own data context logic that executes
I think that business logic should exist in a model when using an MVC
I am using PostSharp to add some compile time logic to my attributes -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.