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

  • Home
  • SEARCH
  • 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 4066088
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:05:32+00:00 2026-05-20T16:05:32+00:00

I want to style the anchor links in my gridview header with css. My

  • 0

I want to style the anchor links in my gridview header with css. My style for the classes th works but the style for th a does not apply to it. It is overwritten by the containing divs a style. Also if I do th a or th a:hover without a preceding class it does not effect the hyperlinks in my th. I have tested this in both IE and Firefox. This is the gridview portion of my css:

.gridview  
{  
    border-color: #9BBE00;  
    border-width: thin;  
    border-style: solid;  
    width: 700px;   
}

.gridview th  
{  
    background-color: #F4A80A; 
    color: White;  
    font-weight: bold;  
}  
.gridview th a  
{  
    font-weight: bold;  
    color:Red;  
}  
.gridview th a:hover  
{  
    font-weight: bold;  
    color:Red;  
}  
.gridview td  
{  
    text-align:center;  
}
  • 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-20T16:05:33+00:00Added an answer on May 20, 2026 at 4:05 pm

    This is probably a specificity issue. CSS rules are weighted not only by their source and order, but according to a formula:

    1. Inline? 1000 points
    2. IDs in selector? 100 points for each
    3. Classes and pseudo-classes? 10 points each
    4. Specific elements? 1 point each

    Therefore you might have something like this:

    div#something a { color: blue; } /* 102 points */
    

    overriding your style:

    .gridview th a { color: red; } /* 12 points */
    

    You can solve this by either making your style more specific:

    div#something .gridview th a { color: red; } /* 123 points */
    

    or using the hackier !important approach:

    .gridview th a { color: red !important; } /* overrides more specific selectors */
    

    To be technically correct, I should mention that this is not really straight addition of points if any position reaches 10. For example, if for some strange reason you had a selector with 12 classes, the specificity weight might be:

    0   1   12   0
    

    That is, don’t carry the one. The above is less specific than:

    0   2   0   0
    

    Finally, I assume you realize your :hover style is the same as your plain link style.

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

Sidebar

Related Questions

There is two links in my body part: but i want to give them
I want to add/remove three css classes plus a default classes. Example: When I
I want to style some forms in Plone3+collective.xdv but I don't want all forms
HI All, I want to know how to style an anchor tag(eg: need to
I have an image in the css, but I want to add a link
I want to change the width and height of the Ckeditor but am not
I want to connect div's using jsPlumb. It works when I used styles, but
Is it possible apply style to all of an anchor tag's pseudo selectors with
I want to style selected text differently, and I'm using ::selection to achieve that.
I want to style my custom scrollbar. I know this is possible with WebKit,

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.