Measure the internal dimensions of the space, not just the external ones of the container.
A container that fits the shelf but not the gap above it is the most common mistake here. Check whether a piece is stackable and whether the stated capacity counts the lid volume.