CSS A (link-anchor) syntax question

S

still just me

I have a question about the syntax of CSS when used on a link (anchor)
tag.

I know how to do change the default link characteristics in a CSS file
and redefine the general link colors:
a:link{color:#FF0000}
a:visited{color:#00FF00}

But how do I define another second style of link? I want to do
something like this(below), but I don't know the syntax for the link
portion:

..otherLinkStyle{a:link:color:#000000; a:visited:color:#CCCCCC;
text-decoration:none;}

Thanks,
 
J

Jukka K. Korpela

Scripsit still just me:
I have a question about the syntax of CSS when used on a link (anchor)
tag.

You should not try to learn the details of syntax before you understand
the essential basics.
I know how to do change the default link characteristics in a CSS file
and redefine the general link colors:
a:link{color:#FF0000}
a:visited{color:#00FF00}

No, you don't. Even if the colors there are just examples (and they are
manifestly _bad_ examples of link colors), there's no justification in
missing the principle "color and background together if at all".
But how do I define another second style of link? I want to do
something like this(below), but I don't know the syntax for the link
portion:

.otherLinkStyle{a:link:color:#000000; a:visited:color:#CCCCCC;
text-decoration:none;}

Why do you try a mess like that? You could just as well write just
DWIM
except that if it worked and had the intended meaning (Do What I Mean),
it would be very helpful!

Defining "second style of link" is surely an advanced topic - not in
terms of CSS syntax but in terms of _design_. Don't even try it before
understanding and practising the basics. See
http://www.cs.tut.fi/~jkorpela/www/links.html
 
R

Rob W.

still just me schreef:
I have a question about the syntax of CSS when used on a link (anchor)
tag.

I know how to do change the default link characteristics in a CSS file
and redefine the general link colors:
a:link{color:#FF0000}
a:visited{color:#00FF00}

But how do I define another second style of link? I want to do
something like this(below), but I don't know the syntax for the link
portion:

.otherLinkStyle{a:link:color:#000000; a:visited:color:#CCCCCC;
text-decoration:none;}

Thanks,

I understand that you want one extra propertie,
that is the same for both a:link and a:visited
this would result in the following:

a:link {color:#FF0000};}
a:visited {color:#00FF00};}
a:link, a:visited {text-decoration:none;}
 
F

freemont

I have a question about the syntax of CSS when used on a link (anchor)
tag.

I know how to do change the default link characteristics in a CSS file
and redefine the general link colors: a:link{color:#FF0000}
a:visited{color:#00FF00}

But how do I define another second style of link? I want to do something
like this(below), but I don't know the syntax for the link portion:

.otherLinkStyle{a:link:color:#000000; a:visited:color:#CCCCCC;
text-decoration:none;}

<html><head><style>a:link{color:#00f;} a:visited{color:#ff0;}
a.otherlink{color:#f00;} a.otherlink:visited{color:#0f0;}</style></head>

<body><p><a href="#">This is normal link</a></p>

<p><a class="otherlink" href="#">This is other style</a></p></body></html>
 
S

still just me

<html><head><style>a:link{color:#00f;} a:visited{color:#ff0;}
a.otherlink{color:#f00;} a.otherlink:visited{color:#0f0;}</style></head>

<body><p><a href="#">This is normal link</a></p>

<p><a class="otherlink" href="#">This is other style</a></p></body></html>

Thanks freemont, exactly what I needed to know.
 
S

still just me

Defining "second style of link" is surely an advanced topic - not in
terms of CSS syntax but in terms of _design_. Don't even try it before
understanding and practising the basics. See
http://www.cs.tut.fi/~jkorpela/www/links.html

Thanks, but I don't need your philosophy or your lecture. I just need
some syntax help. If you don't want to provide it, that's fine, but
the condescending lecture is not helpful.

PS - Your page looks like crap in MSIE. Perhaps it's you who needs to
do some studying of proper design with a view towards multi-browser
support.
 
S

still just me

a:link {color:#FF0000};}
a:visited {color:#00FF00};}
a:link, a:visited {text-decoration:none;}

Not exactly what I needed (freemont nailed that) but still a helpful
technique.

Thanks,
 
J

Jukka K. Korpela

Scripsit still just me:
Thanks, but I don't need your philosophy or your lecture.

You do, but your ignorance is not curable if you decide remain clueless.
I just need some syntax help.

If that had been the case, you would have known how to check the syntax
faster than you sent your question, not to mention any time of other
people wasted in replying to you.
 
S

still just me

You do, but your ignorance is not curable if you decide remain clueless.

Neither the information you posted or your attitude is helpful. Then
again, it's obvious that you didn't intend either to be positive..
If that had been the case, you would have known how to check the syntax
faster than you sent your question, not to mention any time of other
people wasted in replying to you.

Nonsensical and condescending once again. I don't need your help
concerning style. The colors I choose for the example were just that -
colors I chose for an example. You, in what appears to be a standard
method for your responses here, decided to harp on the color selection
as an excuse to post a canned response demonstrating your "obvious
superiority".

In addition, you decided to use that and leverage it into some kind of
a springboard of assuming that I don't know anything about web design
when in fact I can run circles around your academian approach to
building web pages.

Some people want to help and that's why they post here. Note that they
didn't mind me "wasting their time". In fact, they felt good about
helping.

If you don't want to help, don't post. If you don't have time, don't
bother reading posts.

PS - speaking of design: you might want to take some classes in
graphic design and layout including alignment, font selection and
sizing, and color selection. After that you can work on developing
some artistic skills. Let me know when you build your first
non-academic site for a commercial customer.
 

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,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top