HTML CSS examples for HTML Tag:img
The width attribute specifies the width of an image, in pixels.
Value | Description |
---|---|
pixels | The width in pixels (e.g. width="100") |
An image with a height and a width of 42 pixels:
<!DOCTYPE html> <html> <body> <img src="https://www.java2s.com/style/demo/Opera.png" alt="Smiley face" width="42" height="42"> </body><!-- w ww. j a va 2 s .c o m--> </html>