Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- how to specify often-used text just once?
- Sander van der Wal
March 16, 2007, 11:12 am
rate this thread
Is it possible to specify in a html document that you want to resue a piece
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
It looks like it's not possible, but I could have overlooked something.
Sander van der Wal
Re: how to specify often-used text just once?
Sander van der Wal wrote:
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
<!--#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
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
Natural foods can be harmful: Look at all the
people who die of natural causes.
- » Disable printing of flash in favour of internal content
- — Previous thread in » HTML Authoring Forum