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.