October 22, 2011

Resizing an Image Using HTML

You can also modify the size of your image using the width and height attribute. Open your text editor now and key in the code:

<html>
<head>
<title>Images</title>
</head>
<body>
<a href="header.html"><img src="images/pix.jpg" 
alt=”pix” title="pix description" width="160" 
height="114" /></a>
<a href="header.html"><img src="images/pix.jpg" 
alt=”pix” title="pix description" width="100" 
height="80" /></a>
</body>
</html>

The code will be rendered by the browser this way, see the next figure:
About the code:
  • The width attribute tells the browser to set the width of the image.
  • The height attribute tells the browser to set the height of the image.

0 comments: