This question has already been answered:
Created a div element, set it to width width 50% . Through CSS, I inserted a picture into it using the background-image: url(....jpg); property background-image: url(....jpg); . At the same time, the height of the div remained 0px . How to make it automatically adjust to the height of the picture?
background-imageis made to not affect the size of the container - andreymal