I used small brackets and mounted them to the underside of the top of each shelf. You don't need to mount them to the bottom because of the bending moment around the fixing point. Might be getting a bit nerdy here. Anyway, it didn't look that great because you could see them. If I had to do it again, I would probably make something like the drawing attached - that could be concealed between the boxes and be both the spacers between the boxes and the brackets themselves.
Hey Papa,I made them quite a while ago but I think they were 250mm (10 inches) but you can make them as deep or as shallow as you want.
Hack a Toilet for free water.
Wall-mounted horizontal ladder shelf
Analog Word Clock
A wood gear clock with a unique drive mechanism
Build A Cheap Handcrafted CNC Mill
Table-Top Electric Plant
Hanging Yarn Ball Planters (3dprint Version)
Persistence of Vision Wand