I am looking for a way to create a link in a separate .html or .css file so I can paste the reference to that link in all my pages and then not have to worry when I need to update the link. Basically I want to create a variable in my webpage that loads in some specific text, is this possible?
It might be possible, but you're going to need javascript to do it. I don't know javascript well enough to give you exactly what you want, but I can kind of give the logic.
You need a class attached to something like so:
<div class="insertLink"></div>
You might be able to do this as well, but the javascript required might be a little different:
<a class="insertLink"></a>
and then have the javascript insert some html whenever it reads that class. If you search for "insert html using javascript" you might find the code you need.
since that runs user-side it might not be what you want though. you can also use php or some other server-side script, that's how people usually serve web pages with dynamic content. look into using include files, it's probably what you want.
Replies
You need a class attached to something like so:
You might be able to do this as well, but the javascript required might be a little different: and then have the javascript insert some html whenever it reads that class. If you search for "insert html using javascript" you might find the code you need.