Add img element and set src, alt, width and height in HTML and CSS

Description

The following code shows how to add img element and set src, alt, width and height.

Example


<html>
<!--from  ww w . jav  a2s .  c  om-->
<body>

<img src="http://java2s.com/style/download.png" alt="logo" width="300" height ="80" />

</body>

</html>

Click to view the demo

The code above generates the following result.

Add img element and set src, alt, width and height in HTML and CSS