Jump to content

[SOLVED] if image is wider than 770px force width to be 770px? how would I go abotu that?


MadnessRed

Recommended Posts

I have a basic image gallery. it works fine and I have made it fit in well with my site. There is only 1 problem, screenshots uploaded at 1280*1024 or even 1024 mess up everything because the table is only 778px wide. I don't know how I ended up with that width but it jsut seemed to fit all the images.

 

Anyway here is what I want.

 

How would I go about a script that said

 

if ($imagewidth >770)
{
echo '<img src="screenshot.jpg" width="770" />';
}
else
{
echo '<img src="screenshot.jpg" />';
}

 

thanks

ok, thanks, actually looking at the image gallery that will be impossible to force and also you don't get screenshots with a width less than 770 so i think I will force it to permanently 770 but thanks for the link, it will come in useful elsewhere.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.