Oceans make up about 70 percent of Earth’s surface and contain lots of different salts: sodium, chloride, sulfate, magnesium, calcium, potassium, bicarbonate, and bromide. These salts enter the ocean through rivers, which, before entering pass over rocks and soil, and pick up salt along the way.
This salt builds up in the ocean because the only way water can leave the ocean is through evaporation. And when the water evaporates it doesn't take the salt with it. So you end up with less water, and the same amount of salt, resulting in a pretty salty sea.
The same thing can happen to a smaller, landlocked body of water, such as the Great Salt Lake in Utah, where water evaporates quickly in the desert climate—the lake has dropped 20 feet since 1849. A favorite pastime for visitors is to float on the lake like a cork, because the high salt content makes people more buoyant.