Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9068663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:14:40+00:00 2026-06-16T17:14:40+00:00

For our email templates we are currently using the code below to enable backgrounds

  • 0

For our email templates we are currently using the code below to enable backgrounds in some Outlook versions, however, I’ve been trying to wrap my head around VML to see if it’s possible to emulate the CSS properties to some extent, but the little information I find on VML seems incomplete or hard to put into context.

In practice, there are basically just two properties that are mainly of interest, horizontally centered, and repeat-x only. I would assume that these are so basic VML should easily support it, but I can’t figure it out it seems…

<!--[if gte mso 9]>
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
<v:fill type="tile" src="..." color="#000000"/>
</v:background>
<![endif]-->
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:14:41+00:00Added an answer on June 16, 2026 at 5:14 pm

    From what I can dig up, VML background tags are difficult to work with. They don’t appear to be very flexible and I am not sure how much luck you are going to have trying to manipulate them like you would a CSS element.

    That said, shape and image tags appear to be much more cooperative (relative to their VML counterparts). The most interesting article that I found on the topic was this one: https://web.archive.org/web/20140212122122/http://iamskwerl.com/tech/2011/11/html-emails-outlook-and-background-images/

    What the article says is that Outlook tends to throw away CSS properties when it encounters them (as you have no doubt discovered). It then offers two alternative options for applying (image-based) backgrounds:

    1. Set a background image via CSS on the <body> tag of the HTML. Outlook apparently accepts this.
    2. Use VML.

    Now the article discusses applying backgrounds to table cells, however the technique that it uses should be just as valid for applying backgrounds in other contexts. (Worst case you may even want to consider using a table if it gets you the visual layout that you are after).

    So anyways the VML that the author of the article uses is this:

    <!--[if gte mso 9]>
        <v:image xmlns:v="urn:schemas-microsoft-com:vml" id="theImage" style='behavior: url(#default#VML); (+ more CSS)' src="background url" />
        <v:shape xmlns:v="urn:schemas-microsoft-com:vml" id="theText" style='behavior: url(#default#VML); (+ more CSS)'>
        <div>
    <![endif]-->
    <!-- An HTML table -->
    <!--[if gte mso 9]>
        </div>
        </v:shape>
    <![endif]-->
    

    So at a glance if you decide to use an image, you should simply be able to define CSS properties directly on the image tag itself. Your other option is to use a shape which may be better suited to you anyways as you appear to want to use a calculated background. In this case, according to the spec found here http://www.w3.org/TR/NOTE-VML#:

    The VML shape and group elements participate fully in the CSS2 visual rendering model.

    In which case, much as in the above example, you should have no problem applying CSS properties to a shape element using the style tag (as shown in the above example). This should take care of your background-repeat problem.

    As for centering, the spec states the following:

    center-x, center-y

    These properties may be used to specify the center of the block level
    box of the element within its parent container box.

    This should take care of the horizontal-centering issue for you. For information…

    The shape and group elements are containing blocks for their content – they define a CSS2 "block level box".

    …so certain layout problems should be resolvable by applying a containing shape or group element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have deployed Google Apps for our email so don't use POP/IMAP. However, some
I'm using below code for php html email: $to = $email; $subject = 'ABC';
I want to render an HTML-EMail and send it to our customers using some
I'm trying to format our emails by using HTML-formatted templates on Google App Engine
We currently have a specific format for how our email addresses are defined, based
I have a scenario where I am to send email using our own SMTP
We have been using ICS , THtmlSmtpCli to send emails from our applications for
We have been using TeamBuild and test for our continuous integration build for about
We are changing our e-mail templates in Magento. And after changing them, for some
I'm trying to send email with C#. Our email provider suggested that I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.