Welcome to WebmasterWorld Guest from 54.145.209.34

Forum Moderators: not2easy

Defining an Anchor Pseudo Class Inline

Can this be done?

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

10+ Year Member



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)

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



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)

10+ Year Member



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)

WebmasterWorld Senior Member 10+ Year Member



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)

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



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)

WebmasterWorld Senior Member 10+ Year Member



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)

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



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....

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month