Forum Moderators: not2easy

Message Too Old, No Replies

Firefox not picking up css

         

andrewsmd

10:30 pm on Nov 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We are running a content management system that uses xsl to generate some output. When it's all said and done I end up with something like this.
<td class="Normal">
<span class="linkClass"><!--http://link1.com--><a href="http://link1.com" target="_blank">http://link1.com</a></span>
</td>

My css has link class defined as this
.linkClass
{
font-family: Tahoma, Arial, Helvetica;
font-size: 12px;
font-weight: bold;
color:#679966;
text-decoration:underline;
}
.linkClass a:link
{
font-family: Tahoma, Arial, Helvetica;
font-size: 12px;
font-weight: bold;
color:#679966;
text-decoration:underline;
}

The problem I'm having is FF is not picking up that CSS. The link is still just plain blue. Is there some way I can fix this? Note: I have also tried just
<td class="linkClass">
<a href="http://link1.com" target="_blank">http://link1.com</a>
</td>

to no avail

topr8

9:02 am on Nov 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



why not:


<a href="http://link1.com" target="_blank" class="linkClass">http://link1.com</a>
i think it is technically incorrect to put an <a> inside a span.

this works for me in firefox, so if it doesn't for you then you have something else in your style sheet causing the conflict

SuzyUK

9:53 am on Nov 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



topr8, It is OK to put a link in a span, they are both inline elements and can be nested. Though I agree it could be simplified, there should be no need for the span just to add a class if that's its only purpose, either on the link itself or maybe even put the linkclass on the td if that's the existing parent... but in all it doesn't explain why the linkClass itself isn't being read no matter where it is.

andrewsmd, sorry to ask such a silly question, but just checking.. you do have the whole table construct in place do you? - I know you probably have, but I managed to get the browsers to ignore the CSS by literally copying your code snippet from OP.

I like others can get it to work just fine even with your opening code (after I add the table and tr elements), so if that's not it there must be something else in CSS or HTML that is "breaking" the code, have you validated your CSS [jigsaw.w3.org] & HTML [validator.w3.org]

I might have been inclined to think the specificity of the rule, i.e. could the link be picking up it's CSS from elsewhere..BUT as you say the link is showing default blue, I don't think it's an overrule, unless you have your links specified to be default blue.. I think I'd be looking for missing punctuation in CSS or invalid HTML nesting

milosevic

10:20 am on Nov 11, 2010 (gmt 0)

10+ Year Member



Watch out for writing comments like this:

<!--http://example.com-->

You need to put a space between the content of the comment and it's delimiters

<!-- http://example.com --> - or some browsers will completely break, with the page possibly not loading at all.

Oh, and always use example.com which is specifically purposed for this, someone actually owns link1.com.