sign up log in tour help. 1  Tour Start here for a quick overview of the site. 2  Help Center Detailed answers to any questions you might have. 3  Meta Discuss the workings and policies of this site.  About Us Learn more about Stack Overflow the 1  company. Business Learn more about hiring developers or posting ads with  us.
With this set, an image meant to be 5 inches wide at 300dpi will actually display as 5in wide; without this set, the image would display as approximately 15.6in wide since the image is 15000 image pixels across, and by default CSS displays 96 image pixels per inch.
If you only provide one value (e.g. background-size: 400px) it counts for the width, and the height is set to auto. You can use any CSS size units you like, including pixels, percentages, ems, viewport units, etc. If you provide two values, the first sets the background image's width and the second sets the height.