westcoaststyle
Programmer
I'm bringing images in dynamically and I want to size them on the page irregardless of what size they are in the database.
I want to know if there's a way for me to set the width to a specific pixel value and the height will follow suit without me setting the height value.
Say I have an image that's 100x100. If I set width="50", I want the height to automatically know that it should be 50.
Another example: I have an image that's 100x300. I tell the width="50", the height sets itself to 150.
These are just examples so I will not always have images that are the same size so I can't just set height="50%" (I've thought of that).
Any ideas?
Thanks!
I want to know if there's a way for me to set the width to a specific pixel value and the height will follow suit without me setting the height value.
Say I have an image that's 100x100. If I set width="50", I want the height to automatically know that it should be 50.
Another example: I have an image that's 100x300. I tell the width="50", the height sets itself to 150.
These are just examples so I will not always have images that are the same size so I can't just set height="50%" (I've thought of that).
Any ideas?
Thanks!