Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > different link colors

Reply
Thread Tools

different link colors

 
 
blushark
Guest
Posts: n/a
 
      02-25-2009
how do i create different link colors on same web page?

i define how <A> tag look with CSS, but how then do i apply different
formatting to few selected links?

i need to do that to maintain contrast between link color and background.

thanks!
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      02-25-2009
blushark wrote:
> how do i create different link colors on same web page?
>
> i define how <A> tag look with CSS, but how then do i apply different
> formatting to few selected links?


<a class=whatever>


 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      02-25-2009
blushark wrote:
> how do i create different link colors on same web page?
>
> i define how <A> tag look with CSS, but how then do i apply different
> formatting to few selected links?
>
> i need to do that to maintain contrast between link color and background.


Okay this is really basic stuff here. You need to learn what are
"selectors" Reference this:

http://www.w3.org/TR/CSS21/selector.html

Then do the beginner tutorials on CSS at htmldog.com and you will easily
learn the answer in a very short period of time...


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
richard
Guest
Posts: n/a
 
      02-25-2009
On Wed, 25 Feb 2009 13:41:43 +0100, blushark <(E-Mail Removed)>
wrote:

>how do i create different link colors on same web page?
>
>i define how <A> tag look with CSS, but how then do i apply different
>formatting to few selected links?
>
>i need to do that to maintain contrast between link color and background.
>
>thanks!


In your css section:

a:visited {color:Red;}
a:hover {color:Greeen;}
a:active {color:Blue;}
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      02-25-2009
richard wrote:
> On Wed, 25 Feb 2009 13:41:43 +0100, blushark <(E-Mail Removed)>
> wrote:
>
>> how do i create different link colors on same web page?
>>
>> i define how <A> tag look with CSS, but how then do i apply different
>> formatting to few selected links?
>>
>> i need to do that to maintain contrast between link color and background.
>>
>> thanks!

>
> In your css section:
>
> a:visited {color:Red;}
> a:hover {color:Greeen;}
> a:active {color:Blue;}


That will only define the colors for specific states of any link, not
different colors specific links on the page...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-25-2009
Jonathan N. Little wrote:

> blushark wrote:
>> how do i create different link colors on same web page?
>>
>> i define how <A> tag look with CSS, but how then do i apply different
>> formatting to few selected links?
>>
>> i need to do that to maintain contrast between link color and
>> background.

>
> Okay this is really basic stuff here.


I beg to differ. It's much more complicated than really basic CSS things.

> You need to learn what are
> "selectors" Reference this:
>
> http://www.w3.org/TR/CSS21/selector.html


That would be a necessary but not sufficient part of the job.

> Then do the beginner tutorials on CSS at htmldog.com and you will
> easily learn the answer in a very short period of time...


Quite an optimist you are.

The first question should be "do I really need to use different backgrounds
for different links", and the correct answer is mostly "No, not at all". The
problem asked then vanishes in puff of logic.

If you still need to do that, remember to
a) explicitly set the background too (without relying on "inheritance")
b) set different colors for unvisited, visited, and hovered links at least,
possibly also active and focused links, and even for combinations like
:visited:active.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
SAZ
Guest
Posts: n/a
 
      02-25-2009
In article <ni1px5cwk6gv.s0gopvc5600x$(E-Mail Removed)>,
http://www.velocityreviews.com/forums/(E-Mail Removed) says...
> how do i create different link colors on same web page?
>
> i define how <A> tag look with CSS, but how then do i apply different
> formatting to few selected links?
>
> i need to do that to maintain contrast between link color and background.
>
> thanks!
>


Use different classes:

a:link blue { color: blue; }
a:link green { color: green; }
a:link red { color: red; }

<a class="blue" href="bluepage.html">This is a blue link</a>

and so on.

This is basic CSS, so search Google for a more in-depth answer.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      02-25-2009
Jukka K. Korpela wrote:
> Jonathan N. Little wrote:
>
>> blushark wrote:
>>> how do i create different link colors on same web page?
>>>
>>> i define how <A> tag look with CSS, but how then do i apply different
>>> formatting to few selected links?
>>>
>>> i need to do that to maintain contrast between link color and
>>> background.

>>
>> Okay this is really basic stuff here.

>
> I beg to differ. It's much more complicated than really basic CSS things.


Yes if you want to have the fine granularity of control that CSS can
offer for styling the various status of links, and one *should* preserve
indications of visited links, however many sites do not and their
authors are not concerned with it. All they want to do make this link
blue and that link green...

Learning basic selectors beyond *type* selectors such as *class*
selectors is not an overly complicated concept. Yes, CSS is much more
complicated than HTML, but the basics of *class* selectors is pretty
easy to grasp.

>
>> You need to learn what are
>> "selectors" Reference this:
>>
>> http://www.w3.org/TR/CSS21/selector.html

>
> That would be a necessary but not sufficient part of the job.
>
>> Then do the beginner tutorials on CSS at htmldog.com and you will
>> easily learn the answer in a very short period of time...

>
> Quite an optimist you are.


The beginner tutorials are quite simple and easy to understand. If a
newbie wants to do a simple page it will most likely not take too much
to figure it out. Of course there are some folks incapable of of sealing
a zip-lock bag and as such web design may be too taxing. But again I was
talking about basic styling...

>
> The first question should be "do I really need to use different
> backgrounds for different links", and the correct answer is mostly "No,
> not at all". The problem asked then vanishes in puff of logic.
>
> If you still need to do that, remember to
> a) explicitly set the background too (without relying on "inheritance")
> b) set different colors for unvisited, visited, and hovered links at
> least, possibly also active and focused links, and even for combinations
> like :visited:active.
>


Oh come now! The obvious answer is "maybe". More than a few web sites
have sections within their pages that have different background colors
that may necessitate a change in link color. Two *very common*
scenarios, banners and navbars. A different background is logically used
to emphasize and separate such from the regular content of the page.
It is both a logical and legitimate application.

Like precision too, but I think you're nitpicking just a wee bit.



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-25-2009
SAZ wrote:

> a:link blue { color: blue; }
> a:link green { color: green; }
> a:link red { color: red; }
>
> <a class="blue" href="bluepage.html">This is a blue link</a>
>
> and so on.
>
> This is basic CSS, so search Google for a more in-depth answer.


If you say this is basic CSS, we can conclude that by your own judgement,
you don't have a clue of the basics of CSS.

Normal cluelessness aside, you don't even know the distinction between an
element selector and a class selector, and your CSS code doesn't have any
effect.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      02-25-2009
Jukka K. Korpela wrote:
> Jonathan N. Little wrote:
>
>> blushark wrote:
>>> how do i create different link colors on same web page?
>>>
>>> i define how <A> tag look with CSS, but how then do i apply different
>>> formatting to few selected links?
>>>
>>> i need to do that to maintain contrast between link color and
>>> background.

>>
>> Okay this is really basic stuff here.

>
> I beg to differ. It's much more complicated than really basic CSS things.
>
>> You need to learn what are
>> "selectors" Reference this:
>>
>> http://www.w3.org/TR/CSS21/selector.html

>
> That would be a necessary but not sufficient part of the job.
>
>> Then do the beginner tutorials on CSS at htmldog.com and you will
>> easily learn the answer in a very short period of time...

>
> Quite an optimist you are.
>
> The first question should be "do I really need to use different
> backgrounds for different links", and the correct answer is mostly "No,
> not at all". The problem asked then vanishes in puff of logic.


That shouldn't be the first question, it isn't relevant to his
situation. If he already knew how to set the background for *different
kinds of links*, then he wouldn't need to come here to ask how to set
the foreground colors for them, right? He means that he has links
sitting on areas that already have different background colors.

> If you still need to do that, remember to
> a) explicitly set the background too (without relying on "inheritance")
> b) set different colors for unvisited, visited, and hovered links at
> least, possibly also active and focused links, and even for combinations
> like :visited:active.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any library that can convert RGB colors to ANSI colors? ZelluX Python 3 12-01-2008 11:08 AM
TreeNode colors come from anchor colors AAaron123 ASP .Net 1 08-07-2008 07:56 PM
How to link different site-packages to different Python? Davy Python 2 11-10-2007 06:19 AM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM



Advertisments