I am struggling with a dilemma regarding an image that is 1920 pixels wide. My goal is to have it displayed centered and cropped in the browser window when its width exceeds 1024 pixels. In case the browser width is below 1024 pixels, I want the image to be centered and cropped to fit into a 1024-pixel frame and then resized according to the browser width.
Despite my efforts, I have been unable to find a solution for this issue on the internet. Can anyone offer any guidance on how to achieve this or direct me to relevant examples?