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.
Instead, you should use graphics software to resize images and then write their actual sizes in your Web page HTML. Unlike fonts, images can use either HTML or CSS to define the size. You define the width of the image and the height. When you use HTML, you can only define the image size in pixels. If you use CSS, you can use other measurements including inches, centimeters, and percentages. To define your image size using HTML, use the height and width attributes of the img tag. For example, this image would be 400x400 pixels square: height=400 width=400. To define your image size using CSS, use the height and width style properties.