Inbound Internet Marketing Blog

SEO, Blogging, Social Media, Landing Pages, Lead Generation and Analytics

SUBSCRIBE

The HubSpot Inbound Internet Marketing blog covers all of inbound marketing - SEO, blogging, social media, lead generation, email marketing, lead nurturing & management, and analytics. Join 53,183 others and subscribe now!

Subscribe to RSS feed Add us on Facebook! Follow us on Twitter

Get Free Marketing Info!

Get the world's best marketing resources right to your inbox! Join more than 817,000 inbound marketers!

Subscribe by email

Your email:

Listen to this blog!

HubSpot's Inbound Internet Marketing Blog

Current Articles | RSS Feed RSS Feed

Basic HTML Every Marketer Should Know (About Links)

 

.

As a follow up to my first post on Basic HTML Every Marketer Should Know, I wanted to dig a little deeper into links. Hyperlinks are references to resources on the web. They primarly link to other web pages, but can also reference images, documents, audio, or movie files. I often find myself using HTML code directly on blog comments or in forums. Keep this article as a handy reference for hyperlinks and stay tuned for my next post on basic HTML marketers should know about tables.

The Basic Hyperlink

There are 2 key elements to the code in creating a hyperlink (or link).

  1. Reference (href) - the address opened when the link is clicked
  2. Anchor (a) - the display text or image

To recap, here's the basic HTML code for creating a hyperlink.

Code

HTML 1

Display

Check out my recent blog article on Basic HTML Every Marketer Should Know.

If you want to replace the anchor text with an image, use this code instead.

Code

HTML 2

Display

 

Link that Opens in a New Tab/Window

When you want your link to take the visitor to a new tab or window when the link is clicked, use the "target=_blank" reference. Don't overdo this one though. When you're linking to content within your own site, it's a best practice to keep the session in the same window.

Code

HTML 3

Display

This link for my recent blog article will open in a new window.

 

Using a Tracked URL

Tracking tokens allow marketers to track traffic for a specific marketing campaign such as paid search, banner ads, email blasts or newsletters. To create the URL, use the Google URL Builder to define the campaign, source, and name. Once generated, you'll use this new URL as the reference destination and choose the anchor text (or an image) just like the basic link. You'll be able to see the results of your campaign in your analytics tool, like Google Analytics or HubSpot Sources.

Code

HTML 4

Display

Here is where I'd put a link in my email campaign to track visits back to my website.

 

Using the "No Follow" Attribute

There are times when you don't want to pass search engine credit for a link on your site. The "no follow" attribute instructs the search engines that a hyperlink should not affect or influence the target site's rank or authority. However, it's important to note that utilizing "no follow" for PageRank sculpting can be cumbersome and time consuming with little proven benefit

Code

HTML 5

Display

This hyperlink to the Inbound Marketing blog will not pass authority to the search engines.

 

Anchor Links Within a Web Page

Although you typically want to avoid having pages that scroll on and on forever, there are times when you want to link to content referenced at the middle or bottom of a page. The name attribute is invisible to the user and, when used with the anchor attribute allows for linking within an HTML document.

Code

HTML 6

Display

Brian Halligan

Here is where I'd put Brian's bio, typically further down on the page, but you get the idea.

What other HTML tips do you have to share? 

Live Website Optimization: Using Website Grader For Marketing Success

website grade

 

Join HubSpot Experts for a live session for website review and optimization, providing tips for getting found online.

Date & Time: Every Tuesday at 1:00pm ET

Submit your site now for optimization by HubSpot Experts! (2 will be selected)


Posted by Erin Colbert on Wed, May 19, 2010 @ 10:00 AM

COMMENTS

You forgot to mention the title attribute. For example: 
 
If you want to learn more about Ben Griffiths, then visit my blog. 
 
This is good for usability because a visitor can mouse over the link and see the title, and it's good for search engines because they look at the keywords you use in the title.

posted on Wednesday, May 19, 2010 at 10:08 AM by Ben Griffiths


Hmmm. I just noticed that your site stripped the title attribute from my example. 
 
For those that want to see it, you just add title="keyword" within the anchor tag.

posted on Wednesday, May 19, 2010 at 10:11 AM by Ben Griffiths


I haven't had to learn any of this stuff becuase I use Wordpress. Wordpress automates all of these basic coding tasks! I didn't know how to replace a text link with an image, though. Thanks for the tips!

posted on Wednesday, May 19, 2010 at 10:16 AM by Kathleen O'Connor


Well I learned this back in 2005, never forgot and funny it should be listed as Should Know.. 
:P

posted on Wednesday, May 19, 2010 at 12:38 PM by Beth


Good post Brian. This is the very least marketers need to know. Some additions would be adding a border="0" so that the border around an image doesn't appear.

posted on Wednesday, May 19, 2010 at 11:08 PM by Dipankar


Great Erin and important to get back to basics sometimes. I'd recommend making this a series of posts since I think marketers need to learn these things and get even deeper into HTML. 
 
Too many folks rely on WYSIWYG's like Wordpress and you can tell when you go to their sites/blogs since things are not optimized for each browser and other issues. 
 
I'd recommend going into tables next; seems like that is something a lot of folks don't know how to build. 
 
/kff

posted on Thursday, May 20, 2010 at 10:24 AM by Kyle Flaherty


I noticed that this site attribute good example.

posted on Tuesday, May 25, 2010 at 2:11 AM by Oxzen


These Basic HTML posts are a great idea, Erin! 
My 2 cents - you alluded to this point in your earlier HTML post, but I think it's worth mentioning specifically in this "Links" post: from a SEO point of view, the "link text" (the visible, clickable portion of the link) is very important, especially for on-site, on-page optimization. Make sure it's keyword rich, relevant to the info it's linked to, and NEVER just says, "Click Here"!

posted on Thursday, May 27, 2010 at 11:24 AM by Dave Ingalls


Comments have been closed for this article.