An image height and width using attributes:-
<html>
<body>
<h2>Image Size</h2>
<p>we specify the width and height of an image with the width and height attributes:</p>
<img src="img_car.jpg" alt="Car on road" width="350" height="450">
</body>
</html>
<html>
<body>
<h2>Image Size</h2>
<p>we specify the width and height of an image with the width and height attributes:</p>
<img src="img_car.jpg" alt="Car on road" width="350" height="450">
</body>
</html>
OUTPUT:-
- You can use the STYLE attribute to specify the width and height of an image.
- Alternatively, you can use the width and height attributes.
- The width and height attributes always defines the width and height of the image in pixels.
- The width, height, and STYLE attributes are valid in HTML5.
- we suggest using the STYLE attribute. It prevents styles sheets from changing the size of images.
No comments:
Post a Comment