You just include
<head>and then link to dynamic pages with
idof the HTML element you want to replace.
Here's a very simple static example.
If you want an elaborate dynamic example, go see Kottke, he gets paid for this kind of thing.