Jump to content

Setting an href in a stylesheet

Recommended Posts

I'm making a <table> of politicians.


<th colspan="2">Name</th>


<td>List of Committes They Belong To


<li>Budget</li> <!- These will ->

<li>Finance</li> <!- be links ->




Something like that. Now, I want to make each committee name link to something that may change at some point - maybe, to start, it links to the Wiki about that committee, and maybe later I decide I'd rather link to the ".gov" instead. I'd like to avoid having to change every link in the HTML to do this. Is it possible to somehow use classes in the HTML and put the actual links in the CSS so I can make one change there to change all the instances of each link in the HTML? Did I explain that well enough?

Link to post
Share on other sites

CSS changes only the appearance of the elements, nothing more. That is its purpose. You need to change the attributes in the HTML itself.


If you have a server-side language, you can make one menu and load it into all the pages.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...