Resize Image

Asked

Viewed 97 times

1

I need to resize to a fixed size the images coming from getass tried in the html but the images have different sizes so each one gets one size. I wanted to set a fixed size for this image shows with the set size independent of the original image size.

Code:

<td align="Center">
   <?php 
      echo '<img src="'.$objCheck->getass().'" class="" height="15%" width="15%">'; 
   ?>
</td>

There are images that are 90°degrees to the right and some normal. There is no way to standardize this too ?

  • 1

    Just puts width and takes the height HTML, so it automatically resizes according to length.

  • 1

    But do not use width=""... in percentage because it does not assume. A fixed length or height, never both so as not to deform the image

  • See if that reply help you

1 answer

0

Use the attribute style instead of width and height. To fix the image size maybe you can do the following...

<td align="Center">
    <?php 
        echo '<img src="'.$objCheck->getass().'" class="" style="height:15em; width:15em">'; 
    ?>
</td>

The unity em equals the height of a line (actually the height of the source). Or if you want more specific use px to determine the exact pixel size.

css

Browser other questions tagged

You are not signed in. Login or sign up in order to post.