You can also do a ghost button using the border button hack you also listed by using transparent borders, then outline for the border. But you will loose the border-radius :(
Not much in the way of advantages, Outline doesn't affect the flow of the content (a 600px outline could cover your whole email if you wanted).
You can add double borders using a combination of border and outline
You can't use border radius
You can't set just one side, there is no outline-top it's all or nothing.
Also after posting that code I remembered outline doesn't really work in outlook, thought I was being clever but failed :(
Good summary! I've used the border/outline combo successfully in the past, to give buttons double borders. A <div> parent with padding equal to the outline width kept things aligned. And used a VML version for Outlook, with <v:stroke linestyle="thinthin" /> (see docs).
When you guys say bulletproof, what do you mean by that?
I tested your code Stig (I'm also using your button generator, thanks for that). I also tested the modified code from Mohammed but there are so many clients where the button doesn't work that we can hardly say it's bulletproof.
For me something bulletproof is something that works across all email clients, browsers and devices - I know hardly anything works that way with email...
Padding for p, div and a tags is not supported in Outlook 2007/10/13, per this table of CSS Support for popular email clients: https://www.campaignmonitor.com/css/
Hey, did you give the code a try? It actually works, at least in my experience, even in Outlook 2007/10/13.
About https://www.campaignmonitor.com/css/ I'd actually say it's true that Outlook doesn't support padding on a tags, at least not properly. If you add a background color to the link, you'll see what I mean. In this particular case though, you do actually get the spacing around the link, even if the padding behavior in Outlook isn't quite according to the standard.
We might update the CSS guide at some point to better reflect these types of nuances.
You can also do a ghost button using the border button hack you also listed by using transparent borders, then
outline
for the border. But you will loose theborder-radius
:((rough code)
That's interesting, Mark – that worked better than I would've guessed. Outlook rendering is more precise with padding and border though:

Are there any advantages to using outline?
Not much in the way of advantages,
Outline
doesn't affect the flow of the content (a 600px outline could cover your whole email if you wanted).You can add double borders using a combination of
border
andoutline
You can't use border radius
You can't set just one side, there is no outline-top it's all or nothing.
Also after posting that code I remembered outline doesn't really work in outlook, thought I was being clever but failed :(
Good summary! I've used the
border
/outline
combo successfully in the past, to give buttons double borders. A<div>
parent with padding equal to the outline width kept things aligned. And used a VML version for Outlook, with<v:stroke linestyle="thinthin" />
(see docs).This would be completely bulletproof if the button background color filled the entire button in Outlook 2007 and 2010.
When you guys say bulletproof, what do you mean by that?
I tested your code Stig (I'm also using your button generator, thanks for that). I also tested the modified code from Mohammed but there are so many clients where the button doesn't work that we can hardly say it's bulletproof.
For me something bulletproof is something that works across all email clients, browsers and devices - I know hardly anything works that way with email...
Hi,
I had a play around with @Stig Morten Myre's code. I found it wasnt rendering in Gmail the way it should have.
After running it thru inliner it worked like a charm. Just separated the '.btn a' into a seperate class with lang=x.
Litmus tested but cant see it working on Outlook 365
Cheers
Hey Mohammed, you do indeed need to run it through an inliner for it to work in Gmail. Thanks for pointing that out!
Did you check it in Gmail on Android?
I like that this doesn't actually involve any hacks, other than Justin's :hover selector for Gmail.
Hi Stig,
thank you for sharing the snipped.
Is the gmail hover hack still working for you?
I'm trying to make it work with mailchimp email templates, but no luck.
This is not "bulletproof."
Padding for p, div and a tags is not supported in Outlook 2007/10/13, per this table of CSS Support for popular email clients: https://www.campaignmonitor.com/css/
Hey, did you give the code a try? It actually works, at least in my experience, even in Outlook 2007/10/13.
About https://www.campaignmonitor.com/css/ I'd actually say it's true that Outlook doesn't support padding on a tags, at least not properly. If you add a background color to the link, you'll see what I mean. In this particular case though, you do actually get the spacing around the link, even if the padding behavior in Outlook isn't quite according to the standard.
We might update the CSS guide at some point to better reflect these types of nuances.