Is it possible to reference one xhtml file (say a menu) from multiple xhtml files? Sort of like how external css is used to avoid multiple instances of the same code.
I want the layout to reside in one place in case I nee开发者_JAVA百科d to make changes later on.
You need to use some kind of server side scripting language to import your template files. In PHP, you could do something like this:
<html>
<head>
</head>
<body>
<?php include('menu.html'); ?>
<div id="content">
Page specific content here.
</div>
<?php include('footer.html'); ?>
</body>
</html>
XHTML on itself does not support importing files.
精彩评论