Border Radius not working in Outlook Email template

Hi techies,

We can have the different ways to search it on google or stack overflow that border radius not working in outlook CSS, how to make image as round or roundrect, oval, circle in outlook, how to put border radius to image in outlook email template,  etc.

I assure you that at the end of this tech blog you can able to find all the answers related to the Outlook email template and its CSS behavior.

Lets get started...


Just a little brief that why the border radius is not working in the outlook email template

Outlook still support the Vector markup language (VML) when it comes to support the email template CSS which doesn't support most of the CSS3 or HTML5 features that most of the web browsers do. As Border-radius is a feature of CSS3 so its not is not supported by Microsoft outlook.

It means to meet your requirement you have to take reference from VML. Actually, I made it easier for you. Below is the code snippet that will work to solve the problem.

Code Snippet to make round image in outlook email template-


<td valign="top" height="205" width="310">
  <!--[if gte mso 9]>
   <v:roundrect                     
xmlns:v="urn:schemas-microsoft-com:vml"   
xmlns:w="urn:schemas-microsoft-com:office:word"       
  arcsize="5%"  
  strokeweight="0pt"                            
  style="v-text-anchor:middle;height:205px;width:310px;" 
  strokecolor="white"
  border="0"
  >
  <v:fill type="frame"      
    style="height:205px;width:310px;border:0;"
    border="0"
    src=abc.jpg />                          
    </v:roundrect>
  <![endif]-->
  <div style="mso-hide:all">
    <a href="#">
      <img align="center" border="0" src="abc.jpg" class="table-column-image"
        style="border-radius: 6px; max-width: 205px;  display: block; width: 100%;" 
        height="120" width="200" />
    </a>
  </div>
</td>

The Above HTML will give the below result

                                    

If you want more round from the corner change the arcsize attribute accordingly.

If you need some other shape refer use predefined shape  &  fill element link.


Hope you get your answer... Thanks for visiting :) #happylearning

Comments

Popular posts from this blog

C# .Net Core Interview Questions for Freshers and Experienced Developers

15 ways to keep your team motivated while working remotely ?