That happens with the special types of magnetic liquids called ferrofluids. The liquid contains tiny nano particles of iron. So when there’s a magnet near by, the particles make the liquid follow the lines of magnetic force, just like the iron filings near a bar magnet.
Those magnetic liquids are called ferrofluids and they react to the presence of the nearby magnetic by moving to match the magnetic field of the magnet, just like iron particles do when you place them close to a magnet.
Comments