https://vimeo.com/bravodesignince

HTML Basics For Beginners: Part One Embedding Links

If you’re reading this post, chances are you were referred to it by the Bravo Design team regarding your new WordPress CMS website. I’d just like to take a moment and emphasize, probably again, how incredible the WordPress CMS platform is. Faster load times when compared to Joomla and Drupal, and optimized more efficiently than any other CMS right out of the box. Bravo Design Inc. primarily uses WordPress for all of our website commissions because we are all about empowering our clients. So how can we empower our clients further? By showing them some quick and easy HTML basics for making their websites easier to update and keeping them looking great.

Part One: Using The <a> Tag To Embed Links

Let’s get started with the HTML tags you’ll be using the most, starting with the <a> tag. Every time you’d like to insert a link in your post, you’ll be using the <a> tag.

Let’s take a look at how a link is coded in HTML, don’t worry this’ll be painless.

<a href="http://www.google.com">Google</a>

What will be
displayed:

So we see that the only thing visible is the text that is surrounded by the <a> and </a> tags. This is a fundamental concept of HTML; making sure you always close your tags. Forgetting to do so can have some pretty hairy results.

Let’s take a look at an example where a client has forgotten to close their <a> tag.

One of my favorite websites that I use to search the internet is <a href="http://www.google.com">Google. I use it all the time, and I definitely prefer it to using <a href="http://www.bing.com">Bing</a>.

What will be
displayed:

One of my favorite websites that I use to search the internet is Google. I use it all the time, and I definitely prefer it to using Bing.

You’ll notice that the link for http://www.google.com is active for all the text until the next <a> tag is called around the word “Bing.” So we see how forgetting to close our tags can have a drastically adverse effect on our code, so if you take one lesson from this series: Remember to close your tags!

We’ve covered how to use the <a> tag, so let’s take it a step further and make a link open in a new window. Take a deep breath, it’s only an additional 15 characters.

<a href="http://www.google.com" target="_blank">Google</a>

What will be
displayed:

The output looks exactly like our first example, but when we click on the link (go ahead, click it) the link opens in a new window (or tab, depending on how you have your browser configured). The extra snippet of code, target=“_blank” tells the browser that this link should be opened in a new window. By default, the target attribute equals “_self”, meaning that the link will open in the same window that you are browsing.

A good practice is having links within your website (i.e. http://www.mysite.com/services, http://www.mysite.com/about) open in the same window, and having links that lead off of your site (i.e. http://www.google.com, http://www.bing.com) open in a new window.

By now you’re feeling pretty confident about putting links into your website, so I’ll show you just one more cool feature before we move on. What if we’d like to show some more information for our links without taking up more room on our web page? We can do this easily, with use of the “title” attribute in our <a> tag. Let’s try it out.

<a href="http://www.google.com" target="_blank" title="The internet's most used search engine">Google</a>

What will be
displayed:

Doesn’t really look like much, until we roll over the link with our cursor. After holding the cursor still over the link for a moment, we’ll see the title that we entered in our code. So this is a cool way to add some extra information to our links without taking up too much space on our web page.