If you need the image to be a certain size or just need to shrink it, you can add in attributes to change the size of the image. Remember that changing the height and weight in the code will not keep the image in the same proportions automatically, so make sure that if you put in a different size that it will not distort the image. Using this method will not change the file size of the image, for more information on helping your page's load time by decreasing the file size of images please read our article on helping your images load faster.
We will start with our code from the last section:
<img src="Images/image.jpg" align="middle">
To change the width and height of the image, you will need to use the width and height tags:
Now we will insert the tags into our code, putting in the width and height that we want the image to be (in pixels):
<img src="Images/image.jpg" align="middle" width="250" height="320">
Remember that any time you add an attribute, make sure you use quotation marks around the value or it will not work properly. Also, the order of the attributes does not matter, you can also use:
<img src="Images/image.jpg" width="250" height="320" align="middle">
The image will now be the size of the size of 250 x 320.
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: |
877-595-4HUB (4482) 757-416-6627 (Intl.) |
Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!