Page 66 - CSS
P. 66

contain

               contain


              Scale the image, while preserving its intrinsic aspect ratio (if any), to the largest size
              such that both its width and its height can fit inside the background positioning area.


        This makes sure that the background image is always completely contained in the background
        positioning area, however, there could be some empty space filled with your background-color in
        this case:































        cover


               cover


              Scale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size
              such that both its width and its height can completely cover the background positioning
              area.

        This makes sure that the background image is covering everything. There will be no visible
        background-color, however depending on the screen's ratio a great part of your image could be cut
        off:
























        https://riptutorial.com/                                                                               44
   61   62   63   64   65   66   67   68   69   70   71