Resize background image to fit div
===

I have a question about resizing background images. I have a div and it's length varies based on the device the webpage is viewed on.

    PC: Div = 500px * 500px
    Tablet: Div = 300px * 300px
    Mobile: Div = 200px * 200px

I also have an image which is 600px * 600px. I want to fit this image to fill up the div entirely remaining the aspect ratio.

I have searched the web for a good solution. There are several solutions for resizing (but all require background-images) and several for filling up a div (but they all require using non-background-images).

Is there a solutions for combining both?