FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Right click and links





mele
Greetings,
How do you prevent automatic 'underlining' and col0r change of the link? This really bothers, because it's kicking my website out of theme. Is there a way that I can customize this, especually to get rid of that underline.

Also, how do u disable "right" click on certain page w/out using java? is there HTML scrip for that?

Thanks
Lady Elensar
To prevent automatic underline you could use this:

<a href="http://www.link.com/" style="text-decoration: none;">Link</a>

You also can use css linked (the above is inline). I don't know if you use that? And maybe there are many other ways to do this. If you're using many links, you'd better use a linked stylesheet (css).

I'm not sure about your 2nd question. I don't know the answer. Why not use javascript?
Dark_Jedi06
Put this in the head of your page and it should prevent all underlining of links:

Code:
<style> <!-- a{text-decoration:none} //--> </style>


If you want the underline to reappear when someone hovers over the link put this in the head as well:

Code:
<style> <!-- a:hover{text-decoration:underline;} --> </style>
Lady Elensar
I didn't know this works too. I read about it, I thought, but I didn't go into that. I use css linked. Smile
polarBear
to kill the right click functionality on some of your pages, simply use the OnContextMenu event, like this:

Code:
<body onContextMenu="return false;"><!--your web content--></body>
It's not a standard event at all, but usually prevents the user's right click from dropping the usual menu.
mele
Thanks for your reply guys. And especially thank you DarkJedi and polarBear, your methods solved my problem, just the thing that I was looking for. Thanks.
Rhysige
I have to note down that context menu one, I always used some bloody long Javascript. But also note Disabling Right Clicking doesnt do much at all since anything done there can by done via "view" or some other menu at the top.
haavards
About the prevent-context-thing, does anybody know if it works in IE, Opera, Firefox, Safari.. Or only in IE?
SamiTheBerber
Dark_Jedi06 wrote:
Put this in the head of your page and it should prevent all underlining of links:

Code:
<style> <!-- a{text-decoration:none} //--> </style>


If you want the underline to reappear when someone hovers over the link put this in the head as well:

Code:
<style> <!-- a:hover{text-decoration:underline;} --> </style>

Not so Evil or Very Mad use valid Confused
Code:
<style type="text/css">
a {color: #000000; text-decoration: none}
a:hover {color: #333333; text-decoration: underline}
</style>

So it would be valid Very Happy
thame
Or @import a stylesheet.

That way you can have more control over the look without having to manually edit the actual page.
Related topics
Windows Tips&tricks!
Selling Sigs
Basic HTML Introduction
Booting time
751 Useful Windows XP Files
I need help with CSS
X Arcade Version 1.0
Hide Part of Your Web Site from Yahoo!
Virus leftover :)
someone take out the TinyMCE's Right click menu![lock!]
Disable Right click script in CSS ??????
What to do to prevent right click on a flash file ?
Linux file manager needed that will sum sizes of directories
Disable Right Click On ANy Browser
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.