Image width and height attribute

By default the image is displayed with the original size on the browser. To scale an image to a different width and height, the width and height attribute of the <img> element is used.

* Positive integers (in pixels)
* Percentages (percentage of the parent block)

snippet
<html>
<head></head>
<body>
No Border
<img src="logo.jpg" width="200">
Image with border
<img src="logo.jpg" width="300" height="200">
</body>
</html>

Output
No BorderImage with border


Note
If the width and height is changed from the original proportions, the image will be rendered disproportionately an will be distorted.
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +