If you in addition, put heavy bricks on top of the lid of those steel trash cans, then you'll even keep smarter critters out. However, those cans must be tight fitting, no dents in the lid to upper trash can's sealing area, because mice and rodents can fit in to very small holes - mice more so then rats.
If the lid doesn't fit tightly enough, you could just put aluminum foil over the trash can opening and then put the lid over that to get a tighter fit on the cheap.