Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

css problems

Posted 20 Jan 2005 03:39:26
1
has voted
20 Jan 2005 03:39:26 Joe Campoli posted:
Hey all,

The problem I am having is with my links.

This is my code:

body {
background-color: #DAF0FE;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
div#test {
height: 100%;
}
.catdesc {
font-family: Arial;
font-size: 10px;
}
.regtextbold {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333333;
font-weight: bold;
}
.categories {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #333333;
}
.categories a:link {
color: #8B0000;
}
.categories a:visited, .categories a:hover {
color: #E30000;
}
.categories a:active{
color: #8B0000;
}
.regtext {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333333;
}
.regtext a:link {
color: #8B008B;
}
.regtext a:visited, .regtext a:hover {
color: #E30000;
}
.regtext a:active {
color: #8B008B;
}
.mainHeaders{
font-family: Arial, Helvetica, sans-serif;
font-size: x-large;
font-weight: bold;
}
.qualitySites {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #333333;
}
.qualitySites a:link {
color: #000033;
}
.qualitySites a:visited, .qualitySites a:hover {
color: #E30000;
}
.qualitySites a:active{
color: #000033;
}
.sponsor {
color: #990000;
font-size: 10px;
}

Now the problem is, when I add the css to my page and view it in my browser, my regular links (regtext) are supposed to be purple (#8B008B) and visited and hover are supposed to be red (#E30000) but they are reversed when i view it. regular are red and visited are purple and the hover doesnt even work cause well they are all red already! Cant figure this one out, any help??

Dont know what to look for in the HTML coding, so if anyone has any ideas, i cant post it cause I dont have space also because it is adult related content.

Thank You

Edited by - Vox98 on 20 Jan 2005 03:39:59

Replies

Replied 20 Jan 2005 04:17:15
20 Jan 2005 04:17:15 Joe Campoli replied:
ok, I got rid of all class' and re-attached the style sheet and then began to add my styles where needed. and now it works!! I really dont no what went wrong. Does anyone know what conflicts there may be if i add different styles to nested tables? If I have a table and assign it the style of class="regtext" as stated in my css, and then have a nested table with the style of class="categories" would there be a conflict between the 2 tables?
Replied 20 Jan 2005 10:23:16
20 Jan 2005 10:23:16 Dave Thomas replied:
even tho u have the link syntax in the right order, u may try seperating the active, and visited states to have their own definition.

nesting the table may or may mot cause a problem depending on how you set it up, but if you do have any problems with it, then you can assign ID's to the style to target individual elements, no matter where they are in the code.

regards
Dave
Replied 20 Jan 2005 19:34:32
20 Jan 2005 19:34:32 Joe Campoli replied:
hey dave thanx for the reply. i did have the active and visited states seperated before hand but a previous helper had mentioned i could also have it this way. You had mentioned that nesting the tables may or may not cause a problem, would you be able to elaborate on that on what correct way to set it up is? (not to profficient in css code) also the way to assign ID tags? does that have to do with the Span class?
Replied 20 Jan 2005 20:09:37
20 Jan 2005 20:09:37 Dave Thomas replied:
ive just tested your css and it works fine, i think the problem your having is that youve clicked on the link, thus making it a 'visited' state and then as you say it is already red so you dont notice when the hover is being performed.
i'd personally change the hover colour, so you can see what your doing when you mouseover.
css was tested in Firefox and Opera, worked fine.

sample of the html i used
<pre id=code><font face=courier size=2 id=code>
&lt;p&gt; text &lt;span class="regtext"&gt;&lt;a href="#"&gt;link&lt;/a&gt;&lt;/span&gt; reg text link test&lt;/p&gt;
</font id=code></pre id=code>

regards
Dave
Replied 21 Jan 2005 09:19:51
21 Jan 2005 09:19:51 Joe Campoli replied:
I have it working fine now, but when I did test it before it was all the links that were red not just one, but everything is good now. Maybe it has something to do with assigning the class to the table and not individual text? Just a thought.
Replied 24 Jan 2005 08:31:08
24 Jan 2005 08:31:08 Joe Campoli replied:
Ok, dave now im starting to get a little frustrated. So this problem that i thought was fixed.... is not fixed!

So I created a little test page, if you want to have a look I posted it at
members.rogers.com/j-campoli/clients/newsite/test.htm

Links still go all messed up when clicked then hovered, sometimes I'll try to fix the problem and bold links will show as normal links, meaning same font as stated but not the weight! Im not sure whats happening.

thank you again

Joe

ohh, not all css is used in the page, just regtext and categories i believe.

Edited by - Vox98 on 24 Jan 2005 08:32:15

Reply to this topic