Internal link help

A

Andrew S.

I am setting up a Q&A page with the questions listed on top linked to the
corresponding question below.

The problem I am having is using the link class it changes the size but
ignores the color.
The class works with all other links on the page properly.


Since the page is not live I have included one of the links and the CSS
class:

----------------------------
..linkA
{
font-size: 100%;
color:#003399;
text-weight: bold;
text-align: center;
}

a { color: #009999; text-decoration: none; font-weight: bold; font-size:
120%; }
a:visited { color:#009999; font-weight: bold; text-decoration: none; }
a:hover { color: #666666; font-weight: bold; text-decoration: none; }

<a class="linkA" href="#question1/">1. How expensive are water
treatment systems?</a><br />

----------------------------
 
M

m

Andrew said:
.linkA
{
font-size: 100%;
color:#003399;
text-weight: bold;
text-align: center;
}

a { color: #009999; text-decoration: none; font-weight: bold; font-size:
120%; }
a:visited { color:#009999; font-weight: bold; text-decoration: none; }
a:hover { color: #666666; font-weight: bold; text-decoration: none; }

<a class="linkA" href="#question1/">1. How expensive are water
treatment systems?</a><br />

Seems to be working fine for me in Konqueror. The class overrides the
default behavior of <a> as expected. Maybe it's the browser you're
using?

(BTW, if you want your code to validate, always set a background color
when setting a color. If you validate your page, it may help you to find
the problem.)
 
R

Richard

Andrew said:
I am setting up a Q&A page with the questions listed on top linked to the
corresponding question below.
The problem I am having is using the link class it changes the size but
ignores the color.
The class works with all other links on the page properly.

Since the page is not live I have included one of the links and the CSS
class:

I would refrain from using a keyword as a class or id name all together.
use something like "jlink" instead.
 
T

Toby A Inkster

Andrew said:
.linkA
{
font-size: 100%;
color:#003399;
text-weight: bold;
text-align: center;
}

Try using

a.linkA:link { ... }
a.linkA:visited { ... }
a.linkA:hover { ... }
a.linkA:active { ... }
etc

and put all this *below* the CSS for regular links.
 
L

Leif K-Brooks

Richard said:
I would refrain from using a keyword as a class or id name all together.
use something like "jlink" instead.

How is "linkA" a keyword?
 
R

Richard

How is "linkA" a keyword?

Through experience, I have learned that when you use keywords as the basis
of your variable name, it has a tendancy to screw up the works.
If "name" is a keyword, do not use "names".
Where some browsers may accept the usage, will they all?

During the programming of an extensive program in the old BASIC language, I
realized that one of the problems with variable names is not only the usage
of keywords in the name, but the length as well.
Having several that started with "store-compare" and a letter at the end for
differentiation, I simply put that letter at the beginning and all of a
sudden things worked better.

"linka" is a two fold problem. Not only is "link" a keyword, so is "a".
Depending on how well the program is written, the syntax checking may throw
back an error simply because the first few letters matched a keyword.

In my experience of writing programs, I just stay away from using variable
names that contain keywords.
 
L

Leif K-Brooks

Richard said:
"linka" is a two fold problem. Not only is "link" a keyword, so is "a".
Depending on how well the program is written, the syntax checking may throw
back an error simply because the first few letters matched a keyword.

Ignoring the fact that neither is a keyword, I've never seen a browser
which will choke on two keywords being combined (or even a keyword being
used in a class name by itself).
 
A

Andrew S.

Thanks everyone,

I changed the style sheet to the method below and it is now working fine on
all those keyword named classes.

Thanks
Andrew S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top