Resizing Images?

Hi,

I am trying to resize the images from database to ensure that they only fit 80% into a div space. However, the following code does not work. I am really surprised it doesn’t work because the target=‘_blank’ function works. If one HTML function works I cant see why the other doesn’t. Can anyone advise please?

<div class=‘productborder’>
<a href=‘$link’ target=‘_blank’ width=\“10%\” ><img src=‘$image’/></a>
</div>

It doesn’t work because you’re setting width on the a element not the img.

This is nothing to do with php, why have you put the width in the link tag and I do not think it will work with percentages.

I am really surprised it doesn’t work because the target=‘_blank’ function works.

Target goes with links; do you think you can just lump any atribute into any tag ?

It will. Assuming HTML4.01:

http://www.w3.org/TR/html401/struct/objects.html#h-13.2

Width is a valid tag and it accepts a value in pixels or percents.

Hi, thanks. It works fine. I was stupidly putting it in the wrong place.

I tested it at 10% and I could barely see the pictures.