How do I set a background image in e-Newsletter

I am trying to use a photo for a background. I do not want it to tile. How can I make the image the right size and set it to not repeat?

  • Vaughan

    Hi,

    you would need to set a background-size style in your html template for it.

    See http://www.w3schools.com/cssref/css3_pr_background-size.asp

    and use no-repeat.

    for instance;

    <style>
    div {
        background: url('http://domain.com/path/to/image.png');
        background-size: contain;
        background-repeat: no-repeat;
        height: 800px;
        width: 600px;
    }
    </style>

    the above would fill the content area (set at 800px by 600px) with the image.

    <style>
    div {
        background: url('http://domain.com/path/to/image.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }
    </style>

    Would fill the screen with the image, but would stretch the image and would not keep it's aspect ratio, so you are always best setting a specific size for your newsletter in my opinion.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.