Jump to content

Child class overwrite parent class?


5kyy8lu3

Recommended Posts

Hi.  I set my table to a custom class. Like so .ColTitles {}

 

The font color for everything in the table is set to blue according to this class I set.

 

When I'm using a specific column to sort my table with, I use php to add a class="sortedby" to the anchor tab around that column name.  The column name is inside a <td> which is inside that table.  This changes the color of that column name so I can tell visually which column I'm sorting with since it'll be a different color.

 

I tried it and it doesn't work.  I checked the source and it's definitely putting class="sortedby" in the anchor tag and i check the style.css and i definitely uploaded the new on that includes that class.

 

So... this leads me to believe I can't override the main table's class and it just inherits those font properties?

 

I'm not sure what's going on, I know I can make this work with <font color=""> but I'd like to stick with css. Thanks ahead of time.

 

Oh and I'm sure people will ask why I'm using table, i'm using it for tabular data, it's for my IP log table.  ;)

 

UPDATE: ok i decided to just switch to using php to inject an inline style to the anchor tag for now, it worked, but I'd still like an answer to my original question, thanks =)

 

Still not sure how this works but my previous method didn't lol.

 

This didn't work:

 

.sortedby a{
color: #f7f8b9;
}

<?php
echo '<a class="sortedby">BlahBlahBlah</a>
?>

 

but this did:

 

<a style="color: #f7f8b9;">BlahBlahBlah</a>

 

weird

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.