<div align="center"> Not working in Email Editor | Community
Skip to main content
October 17, 2016
Question

<div align="center"> Not working in Email Editor

  • October 17, 2016
  • 2 replies
  • 9716 views

Hey there beautiful people of the Marketo Community,

Do any of you know why this bit of inline styling isn't working?

It seems so straight forward, but I cannot figure out what's going wrong. Any help would be very helpful.

Thanks in advanced,

Danny T.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Grégoire_Miche2
Level 10
October 23, 2016

I do not think align="center" is a standard HTML property of the <div> tag...

If you want to center your button, it has to be included in a larger object which value is 100% and you should rather use margin-left: auto; margin-right:auto.

-Greg

October 24, 2016

Thank you, Gregoire. I was referring to something I read on here: HTML div align Attribute . However, as you pointed out, this isn't the correct way to get the outcome I needed. I'll take your advice and see if it does the trick.

October 24, 2016

Just to add onto what Grégoire said, margin: 0 auto; does not work well on Outlook 2011&13 if I recall, they need text-align:center; on the wrapper div. You can also just make a small table to actually use the align attribute.

Robb_Barrett
Level 10
October 25, 2016

DIVs aren't a good idea in emails. Many email clients don't accept them. You still want to use tables in emails.

Responsive Email 101: HTML & CSS Basics:

DO YOU RECOMMEND USING TABLES OR DIVS?

Email design absolutely requires using a table-based layout and structure. The reason for this is a lack of support for <div>’s by email clients, like Outlook desktop clients, as it pertains to the actual structure and foundation of the HTML. Some email clients do support <div>’s and can be extremely powerful to use for certain hacks and workarounds, especially for responsive email.

CSS available by email client:  CSS Support Guide for Email Clients | Campaign Monitor

Robb Barrett