Responsive Custom Template

Participant

Responsive Custom Template

Hello,

    I know how to create a custom template in constant contact. But it doesn't supports media queries. How can i make my custom template responsive. Please help.

 

Thanks

 

3 REPLIES 3
Member

Hello,

 

It is definitely possible to create a campaign that is enabled to be mobile responsive using custom code emails with Constant Contact. The key to accomplishing this is to ensure that you are using HTML type campaigns instead of XHTML type. The XHTML email type uses a separated style sheet and automatically inlines all class styles to increase mail client compatibility. An additional effect of this is that XHTML emails only allow CSS classes and do not allow any CSS in the XHTML code.

 

If you choose to create your campaigns as an HTML type, then that will resolve the issue and you are not prevented from adding a <style> tag and defining your styles however you like.

 

Best Regards,

Elijah G.
API Support Engineer

Im having a problem with media queries. They work fine a browser, and ignored when I send them thru a campaign using html type.

 

Can you direct me to a working code sample?

Hello,

 

You can use the following code in a custom HTML email to cause all paragraphs to become bold when the window is under 600px wide:

<style>
@media (max-width:600px) {
  p {
    font-weight: bold !important;
  }
}
p {
  font-weight: normal;
}
</style>

It's also important to note that your custom code email must be HTML rather than XHTML to use media queries. If you have any questions, please let me know!

 

Sincerely

Elijah G.
API Support Engineer
Developer Portal

View API documentation, code samples, get your API key.

Visit Page