Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what unit of image width specified in html <img width=xxx>?

Tags:

html

image

I am totally fresh to html language. In the image attached in the html, something we need to specify the width of the image by the following tag

<img width=350 src='/var/tmp.jpg'/>

So what is unit of the width here? I guess it is in pixel? If that's in pixel, does it mean that the size of the image actually relative to the resolution of the display? I open a webpage with a image shown in the width of 350 in different machine with different display of different resolution. I measure of the width of the image shown on the screen, they are the same. So is that any way to I figure out the absolute width of the image in cm or mm (in php)?

like image 550
user1285419 Avatar asked Jan 24 '13 03:01

user1285419


People also ask

What is img width?

The width attribute specifies the width of the image element. The width is defined in pixels, without the 'px' unit. To define the width in % or other unit, use the CSS width property.

What is image size in HTML?

One of the simplest ways to resize an image in the HTML is using the height and width attributes on the img tag. These values specify the height and width of the image element. The values are set in px i.e. CSS pixels. For example, the original image is 640×960.

Which attribute is used to specify width of an image?

The width attribute specifies the width of an image, in pixels.

How do you change the width of an image in HTML?

There is no command for changing an image size. Image dimensions are 'properties' which can be expressed in either the HTML <img> element, as width="150" height="100" attributes in the tag; or, the CSS as style rules applying to specific images.


1 Answers

pixels. the answer must be 30 chars long. so I'm typing more.

like image 161
thekbb Avatar answered Sep 19 '22 18:09

thekbb