1

I don't believe it's a typical thing to see, but I'm curious if this is a possible inline scenario.

I have a table with several rows. Some of those rows may or may not have hrefs. Can I specify link styles inside the or tags? Rather than inside the href tags?

<table>
 <tr style="color:#000;">
   <td></td>   
   <td></td>
   <td></td>
   <td></td>
 </tr>
</table>

Here's how I want to affect links only:

.a { text-decoration:underline;color:#EEE; }

I already placed a style in the <tr> tag, which affects regular text. Can I specify link styles inside there too? Or is that a limit that can only be done from within stylesheets or inside the tag itself?

2 Answers 2

4

Link colors are not inherited from their parent elements. You'll need to specify the color for the links specifically.

Sign up to request clarification or add additional context in comments.

Comments

1

Firstly, let's get some terminology clear so we're all on the same page.

Elements such as the anchor tag <a> can be styled using CSS. Attributes, such as href give certain meaning to the tag they belong too. You cannot style attributes alone.

In order to change the style of all anchor tags (all links) in your site you can simply do:

a{
 /* my styles here */
}

As @ceejayoz pointed out above, link colours are not inherited from their parent and so you either need to style them individually inline <a style="color:#eee"> (which I sugest you avoid doing), or you style them from a stylesheet/css code block.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.