Solved

CSS on hyperlinks

Posted on 2000-04-26
7
240 Views
Last Modified: 2013-12-25
Just out of curiosity, is it possible to color a hyperlink (or regular text) a different color than the underline?  For instance, if I had a green hyperlink like so:

<a href="somepage.html" style="color:green;text-decoration:underline;">

The link text and the underline would be green.  Could I, say, make the underline blue?  Thanks
0
Comment
Question by:jmtt13
7 Comments
 
LVL 18

Expert Comment

by:mgfranz
ID: 2752069
No.
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2756782
But what you can do is assign properties to the items in layers...

And no, I have not done it so don't ask me to do it for you...
0
 

Author Comment

by:jmtt13
ID: 2757232
Do you happen to know of a web site that might reference assigning properties in layers?  This sounds interesting.  Thanks  ;)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 18

Expert Comment

by:mgfranz
ID: 2757258
Look into the <ilayer> and <layer> tags, in NN the link is http://developer.netscape.com/docs/manuals/communicator/dynhtml/index.htm  For IE you can use the <div> tag and z-index refs in CSS.
0
 
LVL 3

Expert Comment

by:bgillbanks
ID: 2777791
why don't you do somehting a lot simpler and use images. Save them as gifs and they will be pathetically small.

IMHO this way is a lot simpler:-)

It does matter about the formatting tho'
0
 
LVL 7

Accepted Solution

by:
nettrom earned 75 total points
ID: 2804308
The answer to your question is: in theory, yes.

You'll have to wrap the link in a SPAN though, and assign the underline color to the SPAN.  E.g:

<span class="blackLine"><a href="..."> ... </a></span>

and then:

<style type="text/css">
..blackLinke {
  text-decoration: underline;
  color: black;
  background: transparent;
}
..blackline a:link {
  color: red;
  background:transparent;
}
/* etc, etc */
</style>

You'll maybe have to add 'text-decoration: none;' to the link.

The underlining should be kept throughout the element, see http://www.w3.org/Style/CSS/Test/current/sec543.htm for an example (although they don't use links).
0
 

Author Comment

by:jmtt13
ID: 2804887
This is just what I was looking for.  Thanks a bunch!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to count occurrences of each item in an array.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now