Naju
Naju

Reputation: 1541

CSS is not loading in Mozilla/Firefox

I have created one web page with static content. My styles are loaded in Internet Explorer but not loaded in Safari and Mozilla.

CSS reference link in the HTML is:

<link rel="stylesheet" type="text/css" href="/stylesheets/style.css">

CSS is:

.linkText{
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 9 pt;
font-weight: normal;
font-style: normal;
color: #015C28;
text-decoration: none;
}

code:

<td bgcolor="#ffffff" width="25%"> <a href="../serverName/xxxxxx.html">
<strong class="linkText"><b>Winback Offers</b></strong></a></td>

Please advise me.

Upvotes: 0

Views: 1075

Answers (5)

Sachin Kale
Sachin Kale

Reputation: 66

You need to add the class to the a tag. Like <a class="linkText" href=""></a>.

Also I have seen that the css color added is incorrect. Like ##015C28. There are 2 hashes present.

Upvotes: 4

Sirko
Sirko

Reputation: 74096

You should reduce the amount of tags to this:

<td bgcolor="#ffffff" width="25%"> 
  <a href="../serverName/xxxxxx.html" class="linkText">
     Winback Offers
  </a>
</td>

Then correct the typos in your CSS to this:

.linkText{
  font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  font-weight: normal;
  font-style: normal;
  color: #015C28;
  text-decoration: none;
}

You did

  • use two # in front of the color code
  • use a space between the 9 and its unit pt

The your output will look like the one in this fiddle.

Upvotes: 2

The Mechanic
The Mechanic

Reputation: 2329

this is because you give class inside the anchor tag that is not valid try this and this will work

<style type="text/css">
.linkText a{
    font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size: 9 pt;
    font-weight: normal;
    font-style: normal;
    color: #015C28;
    text-decoration: none;
}
</style>
<td bgcolor="#ffffff" width="25%">
<span class="linkText">
    <a href="../serverName/xxxxxx.html">Winback Offers</a>
</span>
</td>

Upvotes: 1

spliter
spliter

Reputation: 12599

Apart from having inline styles using HTML attributes (that is a horrible idea)…

  • First of all, no space between 9 and 'pt in' font-size: 9 pt;
  • Second, remove one hash in color: ##015C28;

P.S. Why do you have <b> within <strong>??? It's like saying to a browser "I want the boldest MF text you can give me". Not good, man, not good.

Upvotes: 2

user1400312
user1400312

Reputation:

You haven't given your HTML the Class...

The HTML should be..

<td bgcolor="#ffffff" width="25%" class="linkText"> <a href="../serverName/xxxxxx.html">Winback Offers</a>

Upvotes: 1

Related Questions