Skip to content Skip to sidebar Skip to footer

Resize The Image To Fit The Dimensions Of Td

This table has 2 columns and 5 rows; in each cell I put an image and I need that image to fit the td dimensions. Here is my HTML and CSS code: #menu{ float:right; w

Solution 1:

Just make the images width to 100% and make the height auto to keep the images from looking distorted

so something like

#menuimg{
      display:block; width:100%; height:auto;
}

Solution 2:

If you want it to fit exactly, use width:100% and height:100%.

The properties max-width and max-height do not set the dimensions of an element, they restrict the dimensions.

Solution 3:

Font Size & display block

<tdstyle="font-size:0px"><imgsrc="IMG_URL"width="XXX"style="display:block;"></td>

Post a Comment for "Resize The Image To Fit The Dimensions Of Td"