Something nasty is filthy, foul, dirty, or awful. Nasty isn't a word for anything nice.
The main meaning of nasty is for things that are unpleasant and very gross. If someone throws up in class, at least one student will probably say, "That's nasty!" The smell of a bathroom is nasty. A song full of dirty words is nasty in a different way. Nasty can also mean "extremely." In football, a vicious hit can be called a nasty hit. A mean person is a nasty person too.
adj offensive or even (of persons) malicious
dirty, filthy, lousy
very unpleasant or offensive
characterized by malice
disagreeable to the senses, to the mind, or feelings