Forum Moderators: not2easy

Message Too Old, No Replies

class occurance as link?

Can you make every occurance of a class be a link to a page?

         

reZen

7:59 pm on Jan 19, 2005 (gmt 0)

10+ Year Member



Can you make every occurance of a class be a link to a page?

I would love to associate my class "location" to go to the directions page of my site. Can I do that without copying and pasting an anchor tag around every one?

To be more specific, I am defining this class onto "span"s and would love to be able to just make all occurances of "span class=loc" be a link to the same page. Is this definable in CSS?

createErrorMsg

8:59 pm on Jan 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is this definable in CSS?

Short answer: no. CSS defines the appearance of elements on a page. A link is an element, itself, requiring opening and closing tags and attributes. It's a structural element. CSS is for styling those structural elements, not adding them in.

To do what you want you'll need to turn to scripting languages (JS for client side; PHP for server side) to dynamically locate the element and add the link tag into the code.

cEM

reZen

9:23 am on Jan 20, 2005 (gmt 0)

10+ Year Member



is this kind of thing possible through XML at all? like XLink?