How to change links in CSS?

Is there a way to make something a link by using only CSS?

  • I'm trying to make certain td tags link to a specific page but I don't want to put the links in html because it would be extremely tedious to change the link later on as the table is meant to be very large and I do plan on changing the links at some point. Is there a CSS function that would turn a specific td or div into a link using only the CSS from the included CSS file? And if that's not possible, is there a JavaScript code I can use to identify a specific CSS class that will make it link to another page?

  • Answer:

    You could do it with JavaScript using the DOM or PHP. Either way, it would be a complex script to write. Ron

James Conan Pecke at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

You may be able to do this with the "content" property. Though in general, doing what you propose is a no-no in terms of "proper" design - CSS should be used for website styling, not content. If it's one table in a single HTML file, I don't see why you couldn't use a find/replace function and insert a dummy URL for now. The find/replace function is built into just about every HTML editor (outside Notepad).

Dick L

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.