Forum Samples, Tips and Tricks

putting information in the margin

As long as I'm asking advice, I have another issue that we use extensively. Does anyone publish any sort of document in which information is pushed into the margin? An example would be a textbook, where definitions are printed in the margin next to the paragraph where the word is used (as opposed to the bottom), or a graphic which displays in the margin next to the paragraph that mentions it.
If so, any tips on the best method to get that information into the margin? Right now, I use the following xml and css to put a graphic in the margin:

<marginitem print="pathnameToJPG"/>

marginitem {
display: block;
float: outside;
width: 170pt;
text-align: center;
color: #FFFFFF;
content: attr("print", url) "\A";

(my margins are 172pt on the outside of each page). To the content is also appended a hard return "\A" along with the attribute text-align:center set so that, in the case the graphic isn't 170pt wide, the image will be centered within its block in the margin.
Using this method, none of the regular "flow" is interrupted: I can use a <marginitem> tag wherever I want, and the document will continue to flow properly.
I have the feeling I am doing this the hard way. Anyone can offer any advice?
Alternatively you can use absolute positioning.