How to Make Links in HTML
Links are part of the essential building blocks of the Internet. People click links to navigate sites, to visit other people’s sites, and to explore the many sources of information available on the Internet. If you run a personal or business-related website, it’s very important for you to know how to create and build links through HTML.
Structure of a Basic HTML Link
Links are coded in a special language called Hypertext Markup Language (HTML). Designers, webmasters, and even casual computer users use HTML to create websites in a language computers can interpret, and translate into text and visuals people can understand. HTML is either written in plain text, or automatically encoded by programming utilities.
Here’s an example of a basic HTML link coded in plain text:
<a href=”url”>Text</a>
Anchor Element
<a></a>
The anchor element is a tag that defines the destination of a hyperlink. When the document is read and interpreted by a computer system, the <a> part of the element denotes that a hyperlink is present on the HTML document. The system will continue to read the rest of the lines of code as part of the anchor element referring to the hyperlink, unless the line is closed by the </a> tag.
Href Attribute
href=”url”
The href attribute denotes the hyperlink reference, or where a particular text or element in the HTML document is linked to. The site address or URL is always enclosed by double quotation marks.
Text
Between the open and closed tags of the anchor element, a programmer or designer writes the name of the text that will link to the site address defined in the href attribute. Remember that the linked text should always be closed by the closing tag (</a>) to prevent an entire block or set of text from linking to the profile, resulting in messy code and an awkward-looking site.
Other Elements in an HTML Link
The basic structure of HTML is usually enough to create suitable links in a website, a blog, or any other HTML document. There are other elements, though, that you can use to improve the functionality of the link.
Here’s an example of an enhanced HTML link coded in plain text:
<a href=”url” target=”_blank” name=”content”>Text</a>
Target Attribute
target=”_blank”
target=”_self”
The target attribute instructs the system to open the hyperlink either in a new browser window (”_blank”) or in the same window as the document (”_self”). The instruction is always enclosed in double quotes.
Name Attribute
name=”content”
When you hover the mouse pointer on a link, you may notice a small line of text appear below the cursor. The name attribute allows users to customize the way people view links by attaching a short line of text when the cursor is overed above the link. The line of text is always enclosed in double quotes.
Writing and building HTML links is easy, convenient, and can be done with any HTML editing program or even a plain text editor. You don’t have to be an expert computer programmer or Web designer to make links; all you need is the know-how to make simple lines of code.