Related Articles

Related Articles

HTML | <img> width Attribute
  • Last Updated : 27 May, 2019

The <img> width attribute is used to specify the width of the image in pixels.

Syntax:

<img width="pixels">

Attribute Values: It contains single value pixels which specify the width of the image in pixel.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML img width Attribute
    </title>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <h2>HTML img width Attribute</h2>
  
    <img src=
         alt="GeeksforGeeks logo" 
         width="200px" 
         height="200px">
</body>
  
</html>

chevron_right


Output:

Supported Browsers: The browser supported by HTML <img> width attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :