0
Css text and image
Hi all is width and height necessary for a div element which contains an image. Because when I type the code in, it seems that there is no difference when I input in width and height for a div which contains image. It seems like padding is the one affecting the div area of an image only
1 Antwort
0
It is only necessary to make the image small, bigger or stretch to type the properties for the specific image.
For example, if you have a img with the id "trees" and you want it to be 300px width, and 400px height, you only need to specify to the css with the id selector.
The markups would be like this:
#trees{
height: 400px;
width: 300px;
}
If you put the markups for the div, you are telling the html not the properties of the image, but the properties of the div.