50 points for this just because you are a good person for checking my question

salt on cold water makes things float right , and salt on warm water makes things sink right now why does cold water make things float and warm water makes things sink explain for both points please this is needed for my project thanks!