absolut size for image in mobile device and website css

时间:2016-07-11 20:00:15

标签: css mobile size

ive got a picture that must be in the same size on website and on mobile device.

I configured that css :

.my-pic {
width: 2.5cm!important; 
height: 4.5cm!important;}

for this html :

<img src='/path/to/img.png' class='my-pic'/>

I measured the pic on my website and it's in right size . but on mobile its smaller (1.5cm on 4 cm)

How can I handle that issue ?

1 个答案:

答案 0 :(得分:0)

You need to use media queries, and set the css as per requirement