WordPress.org

Forums

[resolved] CSS to format specific rel= relationships ? (2 posts)

  1. thornomad
    Member
    Posted 8 years ago #

    Hello! I was wondering if there was a standard's compliant way to style links differently based on their rel="attribute" ?

    For example, I use lightbox to display some of the images on my site; I would like to have links to those images styled differently than my other links. From what I know now, I could do a:

    a[href$=".png"] { background: url('linkimage.gif'); }

    However, because I already have to signify my links with a rel="lightbox", I thought that might be a better way to gaurantee that all the links to images with the correct rel= tag would have the little image next to them.

    Can I do that? Thanks!

  2. thornomad
    Member
    Posted 8 years ago #

    Oh never mind, it was obvious. Just change the href to rel like so:

    a[rel="lightbox"] { background: here; }

Topic Closed

This topic has been closed to new replies.

About this Topic