Crabs have adapted in various ways to live in different environments. Their legs, carapace, claws, color and patterns all help with functions like movement, protection from predators, catching food, attracting mates, and camouflage depending on whether they live in rocky, sandy, or coral areas under the sea. The document provides examples of how specific leg shapes, carapace features, claw types, and colorations assist crabs in different habitats.