CSS Image Masking

I use CSS everyday for web design but there is one thing I have always had trouble with and that is image masking… can anyone tell me how I can overlay a mask like the sale badge and border over another image?

I have provided an example below of what I mean, the example being a dress in an e-commerce shop that I can change. I have tried overlapping div’s and combinging background and transparent gifs with no success, can anyone help?