homepage Welcome to WebmasterWorld Guest from 54.196.18.51
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
Defining an Anchor Pseudo Class Inline
Can this be done?
webguru




msg:1204369
 6:38 am on Apr 30, 2003 (gmt 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>

 

Nick_W




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

Yep, can't be done :(

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

Nick

webguru




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

i don't believe that it can't be done. there must be someone who knows how to do it.

grahamstewart




msg:1204372
 9:52 am on Apr 30, 2003 (gmt 0)

Nope - Can't do it and I can't think of any good reason you'd want to. :)

Nick_W




msg:1204373
 10:06 am on Apr 30, 2003 (gmt 0)

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

Nick

papabaer




msg:1204374
 10:19 am on Apr 30, 2003 (gmt 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!)

BlobFisk




msg:1204375
 11:25 am on Apr 30, 2003 (gmt 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....

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved