I have an image that has a specific hight and width attribute hight="250" and width="230" but i want to change the image within my server and therefore change the image on my website but the new image has different dimensions. What should i assign to the value of Hight and width so that it changes with the value of the original file?
How can i assign flexible width and hight attributes to a pictures in HTML?
You need to do some server side programming that will dynamically create the height and width attriibutes of the image that you would like and then add the attributes to the image tag before rendering the HTML down to the client. It is hard to give examples since I don't know what language you are using.
Reply:The size attributes, 250, and 230 are the dimensions of the displayed image, they are not necessarily the size of the current image, it will get scaled to fill a box 250 x 230. If you put a new image on the server with the same name as the current one (and then remove the current one) it will be displayed at the same size as the current picture, no matter what size the actual size of the new image.... hope that makes sense.
I'm pretty sure thats what you are trying to do....
A good idea is to rename the image that you are replacing, add .old onto the end of the filename. Then upload the new image (make sure it is exactly the same name as the image you are replacing (and you have renamed :) ). Also make sure you put it in exactly the same directory as the current image. Now when you open you page you will see your new image in place of the old one, it will be the same size on the page and wont make other items on the page get moved around and reorganised.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment