?
Solved

CSS on hyperlinks

Posted on 2000-04-26
7
Medium Priority
?
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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 300 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

743 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