Click the "Run Instance" button to view the online instance
Background Image
Background image can be resized or scaled responsively.
The following are three different methods:
1. If the background-size property is set to "contain", the background image will adapt proportionally to the content area. The image keeps its proportions:
Click the "Run Instance" button to view the online instance
3. If the background-size property is set to "cover", the background image will be expanded to be large enough so that the background image completely covers the background area. Note that this property maintains the proportions of the image so Some parts of the background image cannot be displayed in the background anchor area.
Click the "Run Instance" button to view the online instance
Different devices display different pictures
Large size pictures can be displayed on large screens, but on small screens It really doesn't display well on the screen. There is no need for us to load large images on a small screen, as this will affect the loading speed. So we can use media queries to display different images based on different devices.
The following large and small pictures will be displayed on different devices:
Click the "Run instance" button to view the online instance
You can use the min-device-width of the media query instead of the min-width attribute , it will detect the device width instead of the browser width. Image size does not change when the browser is resized.