From Zelda Wiki, the Zelda encyclopedia
The spikes typically hurt Link by decreasing a few hearts. Link will come across two types of floor spikes. The first type is static and is always up. The second type rises up and down in a regular pattern. The static Floor Spikes are more common. In select few cases, Floor Spikes can be used to Link's advantage. In the image to the right, the Dodongo is thrown onto the Floor Spikes, taking damage. However, most other enemies aren't affected by them. Many other floor-based obstacles and enemies perform a similar function as Floor Spikes, such as Bombarossa, Goponga Flower, Sea Urchin, and the Tile Worm. All of these can be seen beforehand, but must be dodged.
In A Link to the Past, there is a way to avoid Floor Spikes. By using the Magic Cape, Link can walk right over Floor Spikes with no harm done. This actually necessary (or at least highly recommended) to obtain the Cane of Byrna. It also makes progressing through the later dungeons far easier.
In Ocarina of Time Floor Spikes are far less common. Many of them are in the Water Temple and typically block passage until the water level rises. There are more in the Shadow Temple. Those spikes are invisible, and Link needs the Lens of Truth in order to see them. If Link wears the Hover Boots while walking into one of them, he'll momentarily levitate above it.
Floor Spikes are nearly non-existent in the other 3D games, and play a very small role. There are a few in the Wind Temple of The Wind Waker, but they are raised above the ground, and thus do not pose any real danger to Link. In Twilight Princess, a few in Arbiter's Grounds can be found that spring from the floor when Link gets close to them, and in Spirit Tracks, a Phantom possessed by Princess Zelda can walk through Floor Spikes without harm.
Floor Spikes in The Minish Cap