Welcome to WebmasterWorld Guest from 54.166.191.112

Forum Moderators: not2easy

Message Too Old, No Replies

Defining an Anchor Pseudo Class Inline

Can this be done?

     
6:38 am on Apr 30, 2003 (gmt 0)

New User

10+ Year Member

joined:Apr 2, 2003
posts:15
votes: 0


I can define these css styles like this:

<head>
<style type="text/css">
a:link, a:visited { text-decoration : none; }
a:hover { text-decoration : underline; }
</style>
</head>

however what happens if i don't want to define them like that? I want to call them inside the <a href> instead:

<a STYLE="" href="">link</a>

I try this but didn't work:

<a style="a:link, a:visited { text-decoration : none; } a:hover { text-decoration : underline; } href="">link</a>

7:09 am on Apr 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


Yep, can't be done :(

----I hate saying things like that, I'm usually wrong! - Can't think of a way though....

Nick

7:57 am on Apr 30, 2003 (gmt 0)

New User

10+ Year Member

joined:Apr 2, 2003
posts:15
votes: 0


i don't believe that it can't be done. there must be someone who knows how to do it.
9:52 am on Apr 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 8, 2003
posts:1429
votes: 0


Nope - Can't do it and I can't think of any good reason you'd want to. :)
10:06 am on Apr 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


Damn good point Graham, whats the reasoning behind this, we might be able to come up with a viable alternative...

Nick

10:19 am on Apr 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 31, 2001
posts:1238
votes: 0


The only reason I can think of is would be an attempt to "style" links posted to guestbooks, forums and other such places. But as it stands, the very nature of the construct is doomed to fail... geez, sounds kinda foreboding!

I agree totally! Why would you even want to do this? (even considering the above possible explanation!)

11:25 am on Apr 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 25, 2002
posts:3185
votes: 0


If you really intent on doing it (and I'll add my voice to the "can't see why" chorus!), you may be able to use javascript to accomplish the effect.

onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';"

By no means ideal, and I havn't tested it at all....

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members