M-J-Robbins / good-email-code

Email code resources website
http://www.goodemailcode.com
MIT License
91 stars 8 forks source link

How to use image as h1 #19

Closed stinhambo closed 1 year ago

stinhambo commented 2 years ago

Feature Request:

A lot of emails use a graphical banner which also serves as the email's title. Can you include the best way to use an h1 where the image is the email's title?

M-J-Robbins commented 2 years ago

Hiya, @stinhambo Sorry I missed this, I've got to take another look at my notifications on Github, thought I had it fixed.

Yeah good idea, I cover it a bit in my text in images post. But could be good to go into more detail somewhere too.

The short answer is, put the image inside the <h*> tag. Then the alt text will be read as the heading when a user navigates to it and will also be included in the headings menu.

<h1>
  <img src="" alt="my heading">
</h1>
stinhambo commented 2 years ago

Ah good, because that's what I've done for the last couple of emails :)

It seemed to work well but I thought I'd highlight on your repo.

On Tue, 4 Oct 2022 at 20:32, Mark Robbins @.***> wrote:

Hiya, @stinhambo https://github.com/stinhambo Sorry I missed this, I've got to take another look at my notifications on Github, thought I had it fixed.

Yeah good idea, I cover it a bit in my text in images post https://www.goodemailcode.com/email-accessibility/text-in-images. But could be good to go into more detail somewhere too.

The short answer is, put the image inside the <h*> tag. Then the alt text will be read as the heading when a user navigates to it and will also be included in the headings menu.

my heading

— Reply to this email directly, view it on GitHub https://github.com/M-J-Robbins/good-email-code/issues/19#issuecomment-1266742517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPAEE7LJICRTUIYZCC4ODWBQBU3ANCNFSM567IDXRA . You are receiving this because you were mentioned.Message ID: @.***>

-- Steven Hambleton https://www.linkedin.com/in/hambo/ +61 0424 589 574

Designer, builder and integrator of email templates for Marketo, Pardot, Mailchimp and more!