Fit a picture in a div


#1

Hey everyone,

I have a problem regarding HTML&CSS. How do I fit a picture in a div? E.g. The picture is bigger than the div. How do i resize it?


#2

Hey,

By adding in width and height, If you are using bootstrap than there's a class for responsive image
<img src="https://s3.amazonaws.com/codecademy-images/discuss_cc-logo.png" width="50px" height="10px" />

Img without editing size:


editing size:


#3

It worked. Thank you.