+ 1

How to give a img a height-size and weight-size?

using css how can i gv my image a height and weight

4th Sep 2016, 1:31 PM
smart
4 Réponses
+ 2
Just use 'height' and 'width' propery with image class i.e. .img{ width:40px; height:50px;}
4th Sep 2016, 2:53 PM
Manish Patell
Manish Patell - avatar
+ 2
As mainish said but use a your img id if the style is for a specific image. so the code is: html file: ... <img id="myImg" src"..." alt="..."> ... css file: #myImg{ width:40px; height:50px;}
4th Sep 2016, 10:14 PM
Antonio Panfili
0
If you would like that your images be of same size in terms of height & weight then just give a unique value to your all class attributes inside the img tags i.e <img class="anypreffereablename" scr="img1.extension" alt=""> <img class="anypreffereablename" scr="img2.extension" alt="> NB: anypreffereablename should be same for both img tags Then jst use an external css link i.e: img.anypreffereablename{ width:"specify"px; height:"specify"px;}
5th Sep 2016, 5:07 AM
Akida M Jafar
Akida M Jafar - avatar
0
thanks to u all
8th Sep 2016, 7:50 PM
smart