how to set height and width of image in css | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how to set height and width of image in css

23rd Feb 2017, 6:13 PM
tanuj bisht
tanuj bisht - avatar
2 Answers
+ 3
img{ height:50%; width:50%; } ^^this in your css will change Every img object in your webpage. if you make a class .firstImg{ attributes } then assign it to one image it will style that individual image.
23rd Feb 2017, 6:21 PM
Michael Szczepanski
Michael Szczepanski - avatar
+ 1
You can also Call them on only html file.. Example: <img src="image-name.jpg" height="200px" width="200px">
23rd Feb 2017, 9:34 PM
MD. Rayhanul Kabir Sumon
MD. Rayhanul Kabir Sumon - avatar