SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member rotarjen's Avatar
    Join Date
    Apr 2008
    Location
    Colorado
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Anchor tags in html email

    Hi there,

    I'm looking for help with an html newsletter that has anchor tags to jump to specific articles from the top of the page. All the anchor tags are opening a new browser window with the original file instead of jumping to the place in the open document. Any ideas?
    Here's my code:

    <a href="#article1" target="_self")Article Title</a>

    <p>blah blah blah</p>

    <a name="article1"></a>This is article one. The teaser at the top should jump here.

    (by the way - this is not spam, but a fishing club newsletter going to a group of subscribers who have requested html email)

    thanks!
    Jen

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,253
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)

    target

    Hi rotarjen, welcome to the forums.
    Try having the href value be the link's name without the self. ie.
    HTML Code:
    <a href="#article1">Article Title</a>
    
    <p>blah blah blah</p>
    
    <a name="article1"></a>This is article one. The teaser at the top should jump here.

  3. #3
    SitePoint Member rotarjen's Avatar
    Join Date
    Apr 2008
    Location
    Colorado
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Tried that - same result with or without the Target tag.

    When the email is sent and opened (tried outlook 03, outlook 07, hotmail, & yahoo), the anchor links cause a browser page to launch and the jump to the article in a separate window instead of within the email document.

    Could this be a function of the email program that sends it? I've tried sending through Outlook 03, 07 & hotmail.

    Thanks for any ideas!

    Jen

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,253
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)

    email name links

    It could be the default behavior of the email client. I know my hotmail email always opens links in a new window. The links have always been to an external URL and I have never had a "jump to" link, so I never thought much about it. There may be no way to get around this as email clients are not page browsers (ie. no javascript, limited CSS support) and this may be another limitation. Maybe you could link to the name anchor on the actual page instead of the email "page"?

  5. #5
    SitePoint Member rotarjen's Avatar
    Join Date
    Apr 2008
    Location
    Colorado
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    html email is so twitchy! Someone just forwarded me a newsletter that is using the exact same anchor code that I'm using, and it works fine. It must be something to do with the delivery - browser, email program, who knows!
    Anyway - thanks for the help.

    I'm finding that more and more of my clients want to send html announcements that match the theme of their websites. The basics are easy, but it's tough finding standards that work for all systems - background images, anchor tags, formatting, etc. If anyone out there is interested in more html email discussion, I'd be really interested in sharing tips & tricks.

    Thanks!
    Jen

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,253
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)

    links in HTML email

    You looked at the source code of the email's mark-up and it was the same as you tried? Maybe try sending an exact copy of the working email to yourself (using the email client that worked for the original one) and see if it works.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •