How to Convert an Image to HTML Code
With just a few snippets of HTML code, you can embed an image into any web page, email or other Internet-based HTML or XML document. While you cannot "convert" an image to HTML code, you can save the image locally or at a specific Web address and then designate a place for it in an HTML document. You can also specify how many pixels large the the image should appear, both vertically and horizontally. Read on to learn how to convert an image to HTML code.
Things You'll Need
- HTML editor
Choose an image. It can be any image of any size.
Save the image locally or online. This means that you can save it to your computer or at a specific Web address. If you want other people to be able to see the image online, you need to upload the image to a Web server. Use your website server, or if you have no website, try using Picasa or other image storage and sharing application. Take note of the URL where the photo is saved.
Open an HTML document. Use the image tag and the exact URL of where the image is stored: . This will embed the image into your HTML document. When the user opens that document via a Web browser or other program, the image will appear.
Adjust the width of the image as you wish it to appear, in terms of pixels. Again, use the exact URL of where the image is stored. For example, . This will stretch or shrink the existing width of the image to 400 pixels.
Adjust the height of the image as you wish it to appear, in terms of pixels. For example, . This will stretch or shrink the existing height of the image to 700 pixels.
Combine width and height adjustments as necessary. For example, .