Molar ratios of Mg/Ca and Sr/Ca were measured in two species of ostracod shells preserved in the upper core (15 55 m) of the Heqing Basin in Yunnan Province, southwest China. By correlating the molar ratios between Mg/Ca and Sr/Ca and comparing them with Sr concentrations of the sediments, we suggested that: (1) the molar Mg/Ca and Sr/Ca ratio variations in respective ostracod primo reflected the changes in its ambient water composition and ecology; (2) the molar Sr/Ca ratios responded better to the salinity change linearly than Mg/Ca without aragonite precipitation in the system, and otherwise there was no linear relation between them; and (3) the molar Sr/Ca ratios were mainly controlled by salinity and authigenic carbonate precipitation, whereas the molar Mg/Ca ratios were related to both salinity and temperature. In fact, the rate of ostracod growth owing to temperature controls the fluctuation of Mg/Ca in shells. Here, more attentions should be paid to the constraint of authigenic mineral precipitation processes on the trace elements in ostracod shells and to the correlation between these trace elements in biogenic carbonates and compositions of the sediments in systems and in future in vitro experiments. ostracod shell, molar Sr/Ca ratio, molar Mg/Ca ratio, environmental response, Heqing Basin