PDA

View Full Version : href that is not underlined??



tacbob
10-12-2004, 07:03 AM
Is there script that makes text with links show without the underline???
Also is it possible to change the colour of the text when the cursor rolls over it?
Thanks.

simonf
10-12-2004, 12:37 PM
HI

Simply highlight the hyperlink text and use standard tools to take off underline and change font. To change the font on mouseover try the following:

onmouseout="FP_changePropRestore()" onmouseover="FP_changeProp(/*id*/'id50',1,'style.color','#000080')">

rgds,Simon

tacbob
10-12-2004, 04:34 PM
Simon.

In Dreamweaver I highlight the text, choose to underline it then take it off but it makes no difference?????

Thanks

cr3ative
10-12-2004, 06:56 PM
Use this:

<a href="link"><span style="text-decoration: none">text for link</span></a>

cr3ative

Odin
10-12-2004, 07:48 PM
You can use CSS well here, just put this in your <head> section:


<style type="text/css">
a:link
{ color: #0000FF; text-decoration: none }
a:active
{ color: #0000FF; text-decoration: none }
a:visited
{ color: #0000FF; text-decoration: none }
a:hover
{ color: #FF0000; text-decoration: none }
</style>
That will change all the links on your page (that don't have IDs, classes or styles that contradict). You can probably see it has 4 states for all the links (link (unvisited), active, visited and hover), so you can change the code as much as you want to suit you. If you wanted to change more attributes such as color and text-decoration, just do a google and you should find lists of what you can use.

(Note: If you wanted to keep the above code as it is, you could write it:

<style type="text/css">
a:link,a:active,a:visited
{ color: #0000FF; text-decoration: none }
a:hover
{ color: #FF0000; text-decoration: none }
</style>)

If you only want certain links modified, or you want specific links to have different attributes, you can use CSS classes:

<style type="text/css">
a.other:link,a.other:active,a.other:visited
{ color: #000000; text-decoration: none }
a.other:hover
{ color: #00FF00; text-decoration: underline }
</style>
Then you can change the links you want to change to: <a class="other" href="[whatever]">Link</a>

Or if you want to just stop one link from having underlines, use: <a style="text-decoration: none" href="[whatever]">Link</a>

tacbob
10-14-2004, 08:19 AM
ODIN.

Thanks for that, now i understand. Did you see my message regarding onfocus="this.blur()" removes active link colour . Any ideas? Is anything conflicting? Now that I have the CSS code in place that sets the styles of the links etc, should I remove the stuff from the general 'page properties' I used in Dreamweaver - i.e colours etc of 'links', 'active links', 'visited pages' etc etc.

Thanks

Odin
10-14-2004, 07:45 PM
onfocus="this.blur()" depends really on the browser. If you're using IE, the link won't be able to get an active state and won't show the colour, so you have to pick one or the other. Firefox just flickers the active colour when clicked, as opposed to IE which keeps the link active until the next page loads, and this conflicts with the hover colour which takes priority over it. Just for reference, Firefox does show the active colour (even if a hover colour is set) when you right click on a link though.
So in IE you'd have to sacrifice this.blur or the active colour, and in Fx you'd have to sacrifice the hover colour to show them both.

And yeah, you won't really need the <body> link attributes now (CSS takes priority over them anyway), you may aswell remove them.