How do ensure the shelves will fit?
Use a ruler or measuring tape to mark the locations using a pencil where the rails will be installed.
Use a shelf to approximate and to mark the locations using a pencil where the rails will be installed.