Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    9
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Match span style to anchor style w/o js

    Hey All,
    Wondering if there is a simple way to style a class of span to match the styles established for anchor tags (whatever they might be) to effect a pseudo anchor.
    Ok, I fear that doesn't make a lot of sense... so I'll try to clarify.
    Instead of using
    Code:
    <a href='#' onclick='blablabla'>link text</a>
    or
    Code:
    <a href='javascript:void(0)' onclick='blablabla'>link text</a>
    I would like to use
    Code:
    <span class='pseudo_link'>link text</span>
    where the only properties defined for the pseudo_link class would be something like
    Code:
    .pseudo_link 
    { colors:link; 
     cursor:pointer; 
    }
    without hard coding the hover, active visited colors etc.
    I can maybe see doing it via jQuery retrieving the anchor tag css params on Load and applying them to pseudo_link classed elements, but there must be a better way?

  • #2
    Regular Coder
    Join Date
    Aug 2011
    Location
    U.S.A.
    Posts
    233
    Thanks
    2
    Thanked 48 Times in 48 Posts
    Why don't you not have the "href" portion? Like:

    Code:
    <a>link text</a>
    Would that work?
    WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.

  • Users who have thanked resdog for this post:

    WallabyKid (11-02-2011)

  • #3
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    9
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks resdog!
    That's just the thing, though I did have to add
    Code:
    a.pseudo_link {  cursor:pointer; }
    to my stylesheet.
    So simple... I feel silly now having asked
    Last edited by WallabyKid; 11-02-2011 at 06:57 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •