By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,625 Members | 2,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,625 IT Pros & Developers. It's quick & easy.

how to specify often-used text just once?

P: n/a
Is it possible to specify in a html document that you want to resue a piece
of text?

For instance, I have a navigation bar with links. This navigation bar will
be used on all the webpages. AFAIK, this can only be done by putting the
navigation bar itself in all the html douments. So as soon as something
changes in the navigation bar, you need to fix this in all your pages. Also,
this is for static text, no scripts, no server support.

With CSS is is possible to do thinks that look a bit like this, you can
reuse background images. I am looking for something like this, but then for
foregound text.

It looks like it's not possible, but I could have overlooked something.

--
Sander van der Wal
www.mBrainSoftware.com
Mar 16 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Els
Sander van der Wal wrote:
Is it possible to specify in a html document that you want to resue a piece
of text?
[snip]
It looks like it's not possible, but I could have overlooked something.
http://allmyfaqs.net/faq.pl?Include_one_file_in_another

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 16 '07 #2

P: n/a
On 03/16/2007 06:12 AM, Sander van der Wal wrote:
Is it possible to specify in a html document that you want to resue a piece
of text?
[...]
You could use an IFRAME element:
http://www.w3.org/TR/html4/present/frames.html#h-16.5

Mar 16 '07 #3

P: n/a
Sander van der Wal wrote:
Is it possible to specify in a html document that you want to resue a piece
of text?

For instance, I have a navigation bar with links. This navigation bar will
be used on all the webpages. AFAIK, this can only be done by putting the
navigation bar itself in all the html douments. So as soon as something
changes in the navigation bar, you need to fix this in all your pages. Also,
this is for static text, no scripts, no server support.

With CSS is is possible to do thinks that look a bit like this, you can
reuse background images. I am looking for something like this, but then for
foregound text.

It looks like it's not possible, but I could have overlooked something.
Put the complete HTML for the navigation bar in a separate file. While
complete for the navigation bar, this should be an HTML fragment (no
<!Doctype>, <HTML>, <Head>, etc). Do NOT give the file an HTML or
similar extension. Upload the file to your Web server.

Wherever you want the file to appear in an actual HTML file, put the
following:
<!--#include file="xxx" -->
where xxx (with quotes) is the navigation bar fragment file with its
path on your server relative to your Web root. When you upload such a
HTML file to your Web server, you will have to declare the file
executable.

Note that this requires the Web server to have server-side includes
(SSIs) enabled. You may have to work with the technical help staff for
your server's host to put the navigation bar fragment file in the proper
place and then construct the path to the file for the #include.

--
David E. Ross
<http://www.rossde.com/>

Natural foods can be harmful: Look at all the
people who die of natural causes.
Mar 17 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.