These flowering plants grow in the intertidal zone between the low and high water marks. They live in one of the harshest environments on the planet, and have to survive in saltwater, with freshwater runoff, waterlogged soils and dry conditions at low tide. Mangroves can grow only in more sheltered places, such as in estuaries and along creeks where there are freshwater seeps, and where mud and silt hold nutrients.
Remarkably, unrelated species of mangroves have very similar adaptations. Most mangroves have pneumatophores, ‘breathing’ or aerial roots that absorb oxygen directly from the air, because they usually grow in waterlogged mud with low oxygen levels. To deal with the high salt environment, mangroves either prevent salt from entering their roots, or remove it using glands on their leaves. For example, the under side of the leaves of the common grey mangrove, Avicennia, have small deposits of salt. https://www.qm.qld.gov.au/microsites/mangrove/mangroves.asp
Reproduction is difficult for mangroves because they grow in shifting mud. Some mangroves produce seeds and fruit that float and disperse away from the parent tree. Others have seeds that germinate in the fruit, so the seedling first develops attached to the parent, later to anchor and grow in the mud.
Mangrove forests and woodlands are some of the most productive coastal ecosystems. They contain many microhabitats where a variety of crabs, snails and other molluscs live. Mangrove animals often have an exoskeleton or shell that prevents them drying out at low tide. Some, such as crabs, sift through the mud feeding on detritus, or decaying plant matter. Other animals feed directly on algae or mangrove leaves and seedlings. Juveniles of fish species such as the commercially important Sea Mullet swim from the open seas to develop in the mangroves. Very few terrestrial vertebrates live or feed in the mangroves, so the Water Mouse is a notable exception.