...

View Full Version : Linking in css?



nolikewise
07-22-2007, 07:21 PM
Hi all,

I'd like to ask something.

I have a stlye.css and that is linked to about 80 html pages.These 80 html pages are summaries of lesson. I have a div its id="pagead" on the top of all 80 pages. When i change style.css all 80 pages changes in relation with css. But i would like to show advertisements in this div and make it a link to another site. But there is no option for making link in css.

How can i overcome this?

Is there a piece of code which enables me to insert link code and it makes all 80 pages' div redirect to link?

Maybe java can do this if i can give div id to java code. But i dont know how to do that...
Thank you....

_Aerospace_Eng_
07-22-2007, 09:10 PM
Java is not javascript. Unfortunately you'll have to add the link to each page manually. Many html editors have a mass find and replace feature you could use. I know Dreamweaver has one.

zach4618
07-23-2007, 06:33 AM
You could use php's include function to add the same content to a div on many pages. Unfortunately though you would have to change the extension for every page that you are using to .php in order for that to work.

Here's how it would work though:

example.php:


<p>Here is a paragraph that I want to include on many pages.</p>

page1.php:



<div id="pagead">
<?php include ("example.php"); ?>
</div>


page2.php:



<div id="pagead">
<?php include ("example.php"); ?>
</div>


and so on for all 80 pages...

The resulting code sent to the browser for page1.php and page2.php would be:



<div id="pagead">
<p>Here is a paragraph that I want to include on many pages.</p>
</div>

nolikewise
07-23-2007, 04:33 PM
<?php include ("example.php"); ?>

this is the code thank you very much, solved it thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum