September 16th, 2003, 12:03 PM
-
CSS Help
Is there a way to have the *.css to include a text block. What I want to do is have my address appear at the bottom of every page. Above the address I also want a blue line that is 590 pixels long and 1 pix thick. At the top of the page I would like to also have a pic to appear. If anyone has some suggestions thanks,
Tony
September 16th, 2003, 12:10 PM
-
I do not know how to do it in CSS or if it is possible, but a javascript include would be one workaround... use document.write() to output the text block, save the script with a .js extension, and at the bottom of your pages put:
<script type="text/javascript" src="filename.js"></script>
September 16th, 2003, 12:11 PM
-
That would every page that I create to have the same pic at the top, the blue line and my address at the bottom?
Thanks,
Tony
September 16th, 2003, 12:18 PM
-
To put a pic at the top, you would probably have to make separate script, unless you positioned it absolutely, in which case you would need to make sure it was not going to cover up something... but yes, if logo.js was this:
Code:
document.write("<img src='logo.jpg'><br>");
you could put it in your page with this...
<script type="text/javascript" src="logo.js"></script>
Alternately, you could make something like includes.js and have it be like this...
Code:
function logo() {
document.write("<img src='logo.jpg'><br>");
};
function footer() {
document.write('<hr style="color:blue;height:1px;width:590px;" align=left>');
document.write("This page was created by somebody!");
};
Then in your document head...
<script type="text/javascript" src="includes.js"></script>
And at the top and bottom of the page, call the functions you defined:
Code:
<body>
<script type="text/javascript">logo();</script>
...
<script type="text/javascript">footer();</script>
</body>
September 16th, 2003, 12:20 PM
-
The advantage of css is that I can make a change to the one file and not have to hit every page. I have around 30-40 pages that would need to be changed everytime a changed needed to happen.
Thanks,
Tony
September 16th, 2003, 12:21 PM
-
The script tags would have to be put in every page, but editing the .js file would affect each page. So the script does have the same advantage... the disadvantage is that you have to put the new tags in... whereas you probably have the .css file already.
September 16th, 2003, 05:33 PM
-
In the top pic in need to either embed links of through the script have the links placed. How do i do that??
Thanks,
Tony
September 16th, 2003, 07:28 PM
-