Chapter 29. Transforming Images with HTML Attributes

Browsers that support images can do more than display graphics. They can also resize their physical dimensions.

When you add an image to your page, you generally specify the exact dimensions of the graphic with the width and height attributes of the img tag, as in Figure 29.1.

Listing 29.1. View Source for Figure 29.1.
<img src="logo.jpg" width="150" height="75">
Figure 29.1. Give the exact dimensions of the image in its image tag, and the image appears on the page exactly as you designed it in your graphics software.

But who says you have to give the image's actual ...

Get Web Design Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.