/    Sign up×
Community /Pin to ProfileBookmark

Same text on every page?

I want to be able to have every page on my site include a small text footer, but without having to code it to every page. Is there some way of using CSS for this?

Any suggestions helpful…I didn’t know which forum to post this in so I chose General. If CSS isn’t the way to go about it, what is?

Thanks

to post a comment
Full-stack Developer

9 Comments(s)

Copy linkTweet thisAlerts:
@MyBandwidthSep 02.2003 — Actually you can do it with CSS but now the CSS will have to be on every page.

If you really don't want to use

<!--#include file="footer.html" -->

then the only thing I can think of is frames.
Copy linkTweet thisAlerts:
@Aronya1Sep 02.2003 — I'm not sure how you'd do it if you are hand-coding everything, but if you are using a wysiwyg editor, just create a template, then use the template as the basis for the pages in your site.

Actually, I guess you could create a basic template if you are hand-coding, too.
Copy linkTweet thisAlerts:
@PeOfEoSep 03.2003 — You can use css to do the layout of all of your pages by using a css import. You would stick all of your code into a .css file and then import it on each page, it is different from an include though. Howser to put the same text on each page there are two methods that are commonly used 1. is using an include.

2. using an iframe. I suggest you use a small iframe just because your host might not support ssi or a server side language and this way you can save the footer as an html document.
Copy linkTweet thisAlerts:
@JupacSep 03.2003 — or use wats in my sig it PHP? ?
Copy linkTweet thisAlerts:
@PeOfEoSep 03.2003 — Thats a php include, it can also be done with ssi or shtml etc.
Copy linkTweet thisAlerts:
@MirfusauthorSep 03.2003 — can you tell me more about Iframes?

For CSS do I just add:

<!--#include file="footer.html" -->

to the CSS file, with this calling up the 'footer.html' every time the browser reads it?
Copy linkTweet thisAlerts:
@luke0Sep 03.2003 — wot r frames
Copy linkTweet thisAlerts:
@DaveSWSep 03.2003 — [i]Originally posted by Mirfus [/i]

[B]can you tell me more about Iframes?



For CSS do I just add:

<!--#include file="footer.html" -->

to the CSS file, with this calling up the 'footer.html' every time the browser reads it? [/B]
[/QUOTE]


No. css is different. I don't recommend it because: [b]IE Doesn't support this[/b] so you're probably wasting your time with this. Anyway, just for the record:

Save this code block as footer.css:
<i>
</i>body:after {
content: "The End";
display: block;
margin-top: 2em;
text-align: center;
}

Then paste this in the head section of your document.
&lt;link href="footer.css" rel="stylesheet" type="text/css"&gt;


If you have lots of stuff to add, you need to use a server side technology to include it. To do this you need to know what server side technologies your server supports - e.g. php, asp etc.


the iframe way is this:

in each page you write:

<iframe src="footer.htm" frameborder="0" width="100px" height="50px"><a href="footer.htm">Footer text</a></iframe>

And then you make a new page with your footer on it.

Hope this helps

Dave
Copy linkTweet thisAlerts:
@GavinPearceSep 06.2003 — lol here we go, u new about htaccess files on apache but not about frames.
×

Success!

Help @Mirfus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...