Solved

Hypertext links

Posted on 1998-08-07
3
186 Views
Last Modified: 2010-04-09
Is it possible to turn a line of text into a hyperlink and for it not to change colour or become underlined?
I know that I could use a bitmap instead (with the border turned off) but would prefer to keep it as plain text.

Thanks
0
Comment
Question by:Caralinus
[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
3 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 100 total points
ID: 1845107
Yes, you can!  Except that it was an added feature in the 4.0 browsers.  It's an ability enabled by CSS.
To do just one link like that, you would do it this way:
<A HREF="somewhere.html" style="text-decoration: none; color: black">Click here</A>
Of course, the color would be whatever the color of your text is.

And then if you wanted to make all the links that way you would do this:
<STYLE>
<! --  Hide code from older browsers.
  A:link {color: black;  text-decoration: none}
  A:visited {color: black; text-decoration: none}
 -->
</STYLE>

Enjoy!
Josh
0
 
LVL 28

Expert Comment

by:sybe
ID: 1845108
In version 3 browser the color can only be set when the textlink is in a table (it's crazy but true), the underlining can't be removed.

<table>
<tr>
<td>
<a href="anotherpage.htm"><font color="#000000">click here</font></a>
</td>
</tr>
</table>
0
 
LVL 2

Expert Comment

by:Quixote
ID: 1845109
sybe-

That doesn't work *outside* a table?!?!  I never thought to check that compatibility.

I'd like to point out the usefulness of combining the two above suggestions:


<table><tr><td>

<a href="anotherpage.htm"
   style="text-decoration: none; color: black"><font color="#000000">click here</font></a>

</td></tr></table>


Code like this will give you the following results:

Netscape 2:  link color and underlined
Netscape 3:  black and underlined
Explorer 3:  black and no underline
Netscape 4:  black and no underline
Explorer 4:  black and no underline

So, that's pretty close.  Jbirk's comments about CSS only in version 4 browsers is mostly true:  IE3's partial implementation of JavaScript (JScript) and CSS allow for some tricks to work on more browsers, but IMHO was not worth it for the headaches they have caused.  However, this is one case where it works just dandy.

0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

615 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