First remember mechanical transverse waves can travel inside solids but for liquid only over surface(not inside)..... that statement is for mechanical waves only, not for non mechanical(electromagnetic waves) which do not require any medium.... See explanation by Pramod