Diets of the pipefish Stigmatopora nigra were analysed to determine if food availability was causing S. nigra to distribute according to habitat edge effects. Gut analysis found little difference in the diets of S. nigra at the edge and interior of seagrass patches, regardless of time of day or season. Fish diets did, however, vary with seagrass density: S. nigra in denser seagrass consumed more harpacticoid copepods and fewer planktonic copepods. The lack of difference in prey eaten by S. nigra at the edge and interior of patches suggests either that food was not determining S. nigra distribution patterns within patches or that differences in fish densities across patches meant that relative fish–prey densities were similar at edge and interior positions. Alternatively, any edge effects in diet might be masked by gradients in seagrass structure.