We also know that the earth's magnetic field periodically reverses its polarity. So, if the ocean-floor is in fact spreading, the rocks should record these periods of reversed polarizations. Also, the younges oceanic crust should be along the ridges and oldest along trenches.
Magnetic data recorded in the ocean-floor actually shows both the above mentioned properties.
The data shows patterns of alternating negative and positive magnetic anomalies that form roughly north-south parallel strips. These alternating stripes represent the times when the earth's magnetic field went through reversals. If the anomalies were present just as layers, it would have meant the ocean-floor is stationary. But since the anomalies exist as parallel stripes, it means one set of rocks record the earth's magnetic poles and then eventually moves away from the place it solidified and new crust is formed and records the earth's new magnetic poles. These anomalies were known long before the magnetic reversals were discovered.