Question: Are there ways to resize an image to fit thew window the image is being viewed in *WITHOUT* javascript and limited CSS? 

I ask because I have an email campaign that I send out that features a main image that I want as large as possible *without* scrolling. I have read ways to do this with javascript and jQuery but I do not see a way to do this that the majority of email clients will read and react to properly. Is this possible? And if so - How?

Answer: 
This is the correct way to do it for a html email:

```
<img alt="" src="" width="100%" style="margin: 0; border: 0; padding: 0; display: block;">

```

It will auto resize to match the width of the container element (which should always be a `<td>`).

Note that on some clients (Outlook '07, '10 & '13 in particular), the image will not exceed it's maximum dimensions. If you are working with a max-width fluid template this will not be an issue providing your image width matches the max width.
**HOW TO MAKE AN IMAGE RESIZE ITSELF IN A GMAIL**

First, here is the HTML code we will be working with:

```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Image Resizer</title>
</head>
<body>
    <!-- Point to your image by placing the path in the source (src) attribute. -->
    <img src="http://yourImagePathHere.jpg" style="width:100%; background-repeat:no-repeat; background-size:100%;" />
</body>
</html>

```

NOTE: Notice the part that reads "<http://yourImagePathHere.jpg>". This is the path that points to the image you want resized in the GMail. Put the URL for your image here. In order to run this code
in a browser, you’ll need to have it saved as an HTML document. You can
accomplish this by copying and pasting the code above into a code editor or text
editor (such as Notepad on a PC or TextEdit on a MAC) and save it with the
extension “.html”.

If you are using TextEdit on a MAC, you will need to switch to plain text editing
before pasting the code. To do this, choose “Make Plain Text” from the “Format”
menu.

For this example, we will assume your file name is “**image\_resizer.html**”. If you
need to change the image, you will need to edit the HTML document with a code
or text editor. To do this, right click the HTML document and choose “Open With”
and select a code editor or text editor. Then, swap out the image source path
(bolded in the example above), replacing it with the path that points to the
updated image. Then save, and your HTML file should ready to go and updated
to point to the new image.

If you are using TextEdit on a MAC, you will need to start a new document,
switch to plain text editing, paste the code again, and then change the path to the
image.

Step 1: Open **image\_resizer.html** in a browser. To do this, double click it OR
right click it and select a browser from the “Open With” menu.

Step 2: Click anywhere on the webpage. You can click on the image itself or the
white space on the webpage. The idea here is to make sure that we will have
the pointer’s focus on the window to verify that the page is ready to be selected.

Step 3: Select All. Do this by using “Ctrl + A” on a PC … OR … “Command + A”
on a MAC. The page contents will be highlighted.

Step 4: Copy. Do this by using “Ctrl + C” on a PC … OR … “Command + C” on
a MAC. The page contents will be copied to the clipboard. (That just means that
the computer memorizes it).

Step 5: Now that the contents are copied to the clipboard (memorized by the
computer), open your Gmail and click the compose button. Place your curser in
the content area (click in the area where you type a message).

Step 6: Paste. Do this by using “Ctrl + V” on a PC … OR … “Command + V” on
a MAC.

Step 7. Finish typing your email message and send it.