Solved

Hypertext links

Posted on 1998-08-07
3
146 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
3 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 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

9 Experts available now in Live!

Get 1:1 Help Now